matvp91 / indigo-player

Highly extensible, modern, JavaScript video player. Handles MPEG-Dash / HLS / MPEG-4 and is built on top of the HTML5 video element.
https://matvp91.github.io/indigo-player/
Apache License 2.0
1.25k stars 66 forks source link
dash drm hls hlsjs html5-video mpeg-dash shaka-player video video-player

[!TIP] Hey friend, I'm working on an end-to-end solution nowadays. Check https://github.com/matvp91/mixwave for more info!

Note: Due to other commitments, I'm having a hard time responding to issues (& actually getting them fixed for you guys). I'd be more than happy to accept PR's.

indigo-player

Highly extensible, modern, JavaScript player. 👊

Travis CI jsdelivr

Documentation

Visit the documentation. 😎

Getting started

In a browser

The example below will load a simple MP4 file, and attempt to autoplay it.

<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>

As a module in your bundle

The example below will add indigo-player as a module in your project.

yarn add indigo-player
npm i indigo-player
import IndigoPlayer from "indigo-player";
// Bundle the css file too, or provide your own.
import "indigo-player/lib/indigo-theme.css";

const player = IndigoPlayer.init(container, config);

Mentions

Much ❤️ on getting the word out!

Cheers 🍺