Skip to content

Instantly share code, notes, and snippets.

@disono
Last active January 22, 2018 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save disono/f1ede452fff96df78e66371c7b381266 to your computer and use it in GitHub Desktop.
Save disono/f1ede452fff96df78e66371c7b381266 to your computer and use it in GitHub Desktop.
Clappr Media Player List

Playlist sample

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>clappr</title>
    <script src="http://cdn.clappr.io/latest/clappr.min.js"></script>
</head>
<body>
<div id="player"></div>
<script>
    var playlist = [
        'http://clappr.io/highline.mp4',
        'http://vjs.zencdn.net/v/oceans.mp4',
        'http://d11.cdnvideo.ru/videojs/files/hypnofrog.mp4',
        'http://d11.cdnvideo.ru/videojs/files/m1080.mp4'
    ];
    var player = new Clappr.Player({
        source: playlist.shift(),
        parentId: "#player",
        autoPlay: true,
        hideMediaControl: false,
    });
    // fired when player ends the video
    player.on(Clappr.Events.PLAYER_ENDED, function () {
        if (playlist.length > 0) {
            player.load(playlist.shift());
        }
    });
</script>
</body>
</html>

Disable plugin

player.getPlugin('plugin_name').$el.remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment