You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
578 B
19 lines
578 B
window.hlsPlay = function (url, videoObj) {
|
|
console.log("url==" + url);
|
|
console.log("videoObj==" + videoObj);
|
|
if (Hls.isSupported()) {
|
|
var hls = new Hls()
|
|
hls.loadSource(url)
|
|
hls.attachMedia(videoObj)
|
|
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
|
videoObj.play()
|
|
})
|
|
return hls;
|
|
} else if (videoObj.canPlayType('application/vnd.apple.mpegurl')) {
|
|
videoObj.src = url
|
|
videoObj.addEventListener('canplay', function () {
|
|
videoObj.play()
|
|
})
|
|
return null;
|
|
}
|
|
}
|