indigo-player is an extensible, modern, JavaScript player. With our module system, it's childsplay for developers to add their own logic. Whether it's ads, custom business rules or supporting a new stream format, this documentation should get you started in no time.
- jsdelivr.net: https://cdn.jsdelivr.net/npm/indigo-player/lib/indigo-player.js
- by using your own host:
-
- Let's say you host it at https://mysite.com/js/indigo-player.js,
-
- Make sure you set IndigoPlayer.setChunksPath('https://mysite.com/js/')* before calling
init(...)
as the chunks path.
- Make sure you set IndigoPlayer.setChunksPath('https://mysite.com/js/')* before calling
-
The example below will load a simple mp4 file and attempt to autoplay the video.
<html>
<body>
<div id="playerContainer"></div>
<script src="https://cdn.jsdelivr.net/npm/indigo-player@1/lib/indigo-player.js"></script>
<script>
const config = {
sources: [
{
type: 'mp4',
src: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
}
],
};
const element = document.getElementById('playerContainer');
const player = IndigoPlayer.init(element, config);
// You can use the player object now to access the player and it's methods (play, pause, ...)
</script>
</body>
</html>
The example below will load a dash file, has demo subtitles, thumbnails, and attempt to autoplay it. In order to interact with the player, you can use the player
object returned when initializing indigo-player.
?> Open up the console, and use window.player
to interact with the player above.
- media - mp4
- media - Dash (+ DRM / Widevine & PlayReady) - shaka-player
- media - HLS - hls.js
- media - Native HLS (+ FairPlay) - work in progress
- player - HTML5 video element
- ads - FreeWheel (client-side)
- ads - Google IMA (client-side)
- Chrome 71+
- Firefox 64+
- Edge 44+ on Windows 10
- IE11 on Windows 7 except for DRM content
Previous browser versions will most likely work because we rely heavily on feature detection based on the given configuration.