JSFiddle - React, Tailwind, and code Playground
try WXYZ detroit- another m3u8 -Videojs Example
by dledle2
HTML
<link rel="stylesheet" href="https://vjs.zencdn.net/5.4/video-js.css">
<script src="https://vjs.zencdn.net/5.4/video.js"></script>
<script src="https://videojs.github.io/videojs-contrib-hls/node_modules/videojs-contrib-hls/dist/videojs.hls.min.js"></script>
<video id=example-video width=400 height=300 class="video-js vjs-default-skin" controls>
<source srcNNN='https://content-ausw2.uplynk.com/channel/9c9e4e410b5a471391c116166d8c010e/g.m3u8?v=2&ad=live&ad.cping=1&ad.pingf=3&m.sound=normal&m.playback=autoplay&ad.sz=1x1000&ad.cust_params=fname%3Dlive_stream%26temp%3D80-89%26weather%3Dundefined%26refdomain%3Dwww.google.com%26iframed%3D0%26site%3Dprod%26player_width%3D1280%26player_height%3D720%26ip%3D[Insert_IP]%26ua%3D[Insert_UA]&pbs=5107fc3a776449f6a024ec16f7228d35' src='https://content.uplynk.com/channel/9c9e4e410b5a471391c116166d8c010e.m3u8?v=…er_width%3D1280%26player_height%3D720%26ip%3D[Insert_IP]%26ua%3D[Insert_UA]' srcYYY='https://content.uplynk.com/channel/9c9e4e410b5a471391c116166d8c010e.m3u8?v=%E2%80%A6er_width%3D1280%26player_height%3D720%26ip%3D[Insert_IP]%26ua%3D[Insert_UA]' srcZZZ="https://content.uplynk.com/channel/9c9e4e410b5a471391c116166d8c010e.m3u8?v=%E2%80%A6er_width%3D1280%26player_height%3D720%26ip%3D[Insert_IP]%26ua%3D[Insert_UA]"
type="application/x-mpegURL">
</video>
<!--
http://wgntribune-lh.akamaihd.net/i/WGNPrimary_1@304622/index_2500_av-b.m3u8?sd=10&rebase=on
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){}
var myStrURL='http:' + window.location.href.substring(window.location.protocol.length);
console.log(myStrURL);
myStrURL=myStrURL.replace('/light','');
/* potention case-sensitive issue if i copy/paste to other websites */
console.log(myStrURL);
try{window.open(myStrURL , '' , ''); }catch(e){}
}
else
{
/* xxx; */
var player = videojs('example-video');
player.play();
}void(0);