JSFiddle - React, Tailwind, and code Playground

try cbsn 120k bitrate- another m3u8 -Videojs Example

by dledle2

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.15.0/videojs-contrib-hls.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/7.0.0/video.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/video.js/7.0.0/video-js.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/7.0.0/alt/video.core.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/video.js/7.0.0/alt/video-js-cdn.css">
<video id=example-video width=400 height=300 class="video-js vjs-default-skin" controls>
  <sourceZZZ  src='//cbsnewshd-lh.akamaihd.net/i/CBSNHD_7@199302/index_700_av-p.m3u8'
     type="application/x-mpegURL">
  <source  src='//cbsn-us-cedexis.cbsnstream.cbsnews.com/out/v1/55a8648e8f134e82a470f83d562deeca/master.m3u8'
     type="application/x-mpegURL">
     
</video>
<!--
https://s3-us-west-2.amazonaws.com/hg-video-out/Karolyi,_Tracy_34MQ5_about_me_videod737bccd1ac88a5251ef887734a2f0ab21114f331a25ab7abd9a1e4e46a39f6d/hls_d737bccd1ac88a5251ef887734a2f0ab21114f331a25ab7abd9a1e4e46a39f6d.m3u8

   // -->

JavaScript

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




/* myStrURL= */
/* try{window.open(myStrURL , '' , '');    }catch(e){} */
window.boolWindowOpenedSuccessfullyAlready = false;

function inIframe () {
    try {
        /* below command will cause a permissions error when using iframes */ 
        /* and will break into the catch part for error handling           */
        return window.self !== window.top;
    } catch (e) {
        return true;
    }
}

function isURLjsfiddleshowlight () {
   if (       document.location.href.toLowerCase().contains('/show/light/')       )
      {return true;}
   else
      {return false;}
   /* below end bracket: end of function: isURLjsfiddleshowlight*/
}


try{
if (inIframe() === true){
   if (window.open(window.location.href)){window.boolWindowOpenedSuccessfullyAlready=true;}  
}
/* if (isURLjsfiddleshowlight() != true){window.open(window.location.href);    }  */
}catch(e){}
/* alert(window.boolWindowOpenedSuccessfullyAlready);    */




function myFuncinIframeAndAlsoWindowOpenSameFunction() {

if (typeof window.boolWindowOpenedSuccessfullyAlready == 'undefined')
{ window.boolWindowOpenedSuccessfullyAlready=false; }

console.log(window.boolWindowOpenedSuccessfullyAlready);
if (window.boolWindowOpenedSuccessfullyAlready ===false) {
   try {
      if(window.self !== window.top){
         if (window.open(window.location.href)){window.boolWindowOpenedSuccessfullyAlready=true;}
         /*   */ 
      }
   }catch(e){}
}
console.log(window.boolWindowOpenedSuccessfullyAlready);
   /* below end bracket: end of function: myFuncinIframeAndAlsoWindowOpenSameFunction */
}


myFuncinIframeAndAlsoWindowOpenSameFunction();

/* myStrURL=window.location.href;  */
/* try{window.open(myStrURL , '' , '');    }catch(e){}  */











if (location.protocol != 'http:') {
  
try{location.href = 'http:' +...