JSFiddle - React, Tailwind, and code Playground

try2- msnbc 296 -Clappr.JS

by dledle2

HTML

<!--  working m3u8 via Clappr.JS playing and clappr.min.js via github    // -->
<!-- <script src='//github.com/clappr/clappr/raw/master/dist/clappr.min.js'></script> // -->
<script src='//cdn.jsdelivr.net/gh/clappr/clappr@latest/dist/clappr.min.js'></script>
<script src='//cdnjs.cloudflare.com/ajax/libs/clappr/0.2.71/clappr.min.js'></script>
<!-- 
cdn.clappr.io/latest/clappr.min.js
cdn.jsdelivr.net/clappr/latest/clappr.min.js
cdn.jsdelivr.net/clappr/0.2.66/clappr.min.js
cdn.jsdelivr.net/gh/clappr/clappr@latest/dist/clappr.min.js
cdnjs.cloudflare.com/ajax/libs/clappr/0.2.71/clappr.min.js
cdn.clappr.io/latest/clappr.min.js

https://cdn.jsdelivr.net/clappr.rtmp/0.0.19/rtmp.min.js
https://cdn.jsdelivr.net/clappr.rtmp/0.0.19/assets/RTMP.swf


https://cdn.jsdelivr.net/clappr.dash-shaka-playback/2.0.15-beta/dash-shaka-playback.js

https://github.com/clappr/clappr/issues/241

cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// -->

<div id="player-wrapper"></div>

JavaScript

$(function () {


if (location.protocol != 'http:') {
  
try{location.href = 'http:' + window.location.href.substring(window.location.protocol.length);    }catch(e){}}

if (location.protocol != 'http:') {
  
try{window.open('http:' + window.location.href.substring(window.location.protocol.length));    }catch(e){}}



    var player = new Clappr.Player({
        sourceZZZ: 'http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8',
        sourceYYY: 'https://s3-us-west-2.amazonaws.com/hg-video-out/Karolyi,_Tracy_34MQ5_about_me_videod737bccd1ac88a5251ef887734a2f0ab21114f331a25ab7abd9a1e4e46a39f6d/hls_d737bccd1ac88a5251ef887734a2f0ab21114f331a25ab7abd9a1e4e46a39f6d.m3u8',
        sourceNNN: 'Zhttp://spswxyz-i.akamaihd.net/hls/live/203378/anvato/348k/prog.m3u8?anv=1428346792363&X-Anvato-',
        sourceMMM: 'http://cspan1-lh.akamaihd.net/i/cspan1_1@304727/index_1000_av-p.m3u8?sd=10&rebase=on',
        source: 'http://tvemsnbc-lh.akamaihd.net/i/nbcmsnbc_1@122532/index_296_av-p.m3u8?sd=10&rebase=on',
        parentId: "#player-wrapper",
        autoPlay: true
    });
/*
    player.on(Clappr.Events.PLAYER_ERROR, function (a) {
        console.log('PLAYER_ERROR!', a.error.code)
    });
    player.on(Clappr.Events.PLAYER_PLAY, function () {
        console.log("PLAYER_PLAY!")
    });
    player.on(Clappr.Events.PLAYER_ENDED, function () {
        console.log('PLAYER_ENDED!')
    });
    player.on(Clappr.Events.PLAYER_PAUSE, function () {
        console.log('PLAYER_PAUSE!')
    });
    player.on(Clappr.Events.PLAYER_RESIZE, function (a) {
        console.log('PLAYER_RESIZE!', a)
    });
    player.on(Clappr.Events.PLAYER_SEEK, function (a) {
        console.log('PLAYER_SEEK!', a)
    });
    player.on(Clappr.Events.PLAYER_STOP, function () {
        console.log('PLAYER_STOP!')
    });
    player.on(Clappr.Events.PLAYER_TIMEUPDATE, function (a, b) {
        console.log('PLAYER_TIMEUPDATE!', a, b)
    });
    */
});void(0);