mirror of
https://github.com/yangbvv/yangbvv.github.io.git
synced 2025-12-18 07:45:10 +08:00
13 lines
411 B
JavaScript
13 lines
411 B
JavaScript
var video = document.getElementById('video');
|
|
var vurl = location.search.split('vurl=')[1];
|
|
var videoSrc = vurl;
|
|
// 检查浏览器是否支持hls
|
|
if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
|
video.src = videoSrc;
|
|
// 如不支持则调用hls.min.js
|
|
} else if (Hls.isSupported()) {
|
|
var hls = new Hls();
|
|
hls.loadSource(videoSrc);
|
|
hls.attachMedia(video);
|
|
}
|