Created
June 29, 2021 03:59
-
-
Save shuaiscott/55ac54b5adf4cc6561231d966bfc26c7 to your computer and use it in GitHub Desktop.
Video.js LiVE HLS stream, chromecast (HTTPS) TEST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<video id="streamplayer" class="video-js vjs-big-play-centered" width="640px"> | |
<source src="https://irtdashreference-i.akamaihd.net/dash/live/901161/keepixo1/playlistBR2.m3u8" type="application/x-mpegurl"><source> | |
</video> | |
Test Stream URL: | |
<input type="text" id="streamURL" value="https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8" size="50"> | |
<button onClick="loadStream()">Load</button><br> | |
<button id="ytURL" value="https://youtu.be/9f8LjrVgR3k" onclick="ytStream()">YT 1</button> | |
<button id="ytnURL" value="https://youtu.be/vD-SYeXKFec" onclick="ytnStream()">YT 2</button> | |
<button id="adURL" value="https://irtdashreference-i.akamaihd.net/dash/live/901161/keepixo1/playlistBR2.m3u8" onclick="adStream()">ADV Stream</button> | |
<button id="Live" value="https://nmxlive.akamaized.net/hls/live/529965/Live_1/index.m3u8" onclick="LiveStream()">LiVE</button> | |
<button id="bbURL" value="https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8" onclick="bbStream()">BipBop</button> | |
<button id="ADVbbURL" value="https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8" onclick="ADVbbStream()">ADV BipBop</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options; | |
options = { | |
plugins: { | |
httpSourceSelector: | |
{ | |
default: 'auto' | |
} | |
}, | |
youtube: { | |
ytControls: 0, //1=YT control active | |
playsinline: 1, | |
modestbranding: 1, | |
iv_load_policy: 3, | |
rel: 0, | |
}, | |
controls: true, | |
preload: 'none', | |
techOrder: [ 'chromecast', 'html5', 'youtube' ], | |
html5: { | |
hls: { | |
overrideNative: !videojs.browser.IS_SAFARI, | |
}, | |
} | |
}; | |
(function(window, videojs) { | |
var player = window.player = videojs('streamplayer', options); | |
player.httpSourceSelector(); | |
player.chromecast(); | |
}(window, window.videojs)); | |
function loadStream(){ | |
console.log("Change stream to : "+document.getElementById("streamURL").value ); | |
player.src({ type: "application/x-mpegURL", src: document.getElementById("streamURL").value }); | |
player.controls(true); | |
}; | |
function ytStream(){ | |
console.log("Change stream to : "+document.getElementById("ytURL").value ); | |
player.src({ type: "video/youtube", src: document.getElementById("ytURL").value }); | |
player.controls(true); | |
player.play(); | |
}; | |
function ytnStream(){ | |
console.log("Change stream to : "+document.getElementById("ytnURL").value ); | |
player.src({ type: "video/youtube", src: document.getElementById("ytnURL").value }); | |
player.controls(true); | |
player.play(); | |
}; | |
function adStream(){ | |
console.log("Change stream to : "+document.getElementById("adURL").value ); | |
player.src({ type: "application/x-mpegURL", src: document.getElementById("adURL").value }); | |
player.controls(true); | |
player.play(); | |
}; | |
function LiveStream(){ | |
console.log("Change stream to : "+document.getElementById("Live").value ); | |
player.src({ type: "application/x-mpegURL", src: document.getElementById("Live").value }); | |
player.controls(true); | |
player.play(); | |
}; | |
function bbStream(){ | |
console.log("Change stream to : "+document.getElementById("bbURL").value ); | |
player.src({ type: "application/x-mpegURL", src: document.getElementById("bbURL").value }); | |
player.controls(true); | |
player.play(); | |
}; | |
function ADVbbStream(){ | |
console.log("Change stream to : "+document.getElementById("ADVbbURL").value ); | |
player.src({ type: "application/x-mpegURL", src: document.getElementById("ADVbbURL").value }); | |
player.controls(true); | |
player.play(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdn.jsdelivr.net/npm/video.js@7.7.3/dist/video.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-youtube/2.6.0/Youtube.min.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/@silvermine/videojs-chromecast@1.2.0/dist/silvermine-videojs-chromecast.min.js"></script> | |
<script src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script> | |
<script src="https://cdn.jsdelivr.net/gh/DJ-PD/test/videojs-http-source-selector.js"></script> | |
<script src="https://cdn.jsdelivr.net/npm/videojs-contrib-quality-levels@2.0.9/dist/videojs-contrib-quality-levels.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://cdn.jsdelivr.net/npm/video.js@7.7.3/dist/video-js.min.css" rel="stylesheet" /> | |
<link href="https://cdn.jsdelivr.net/npm/@silvermine/videojs-chromecast@1.2.0/dist/silvermine-videojs-chromecast.css" rel="stylesheet" /> | |
<link href="https://cdn.jsdelivr.net/gh/DJ-PD/test/videojs-http-source-selector.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment