标签:ESS list ext tran tac player scree media char
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script> <!-- Or if you want a more recent canary version --> <!-- <script src="https://cdn.jsdelivr.net/npm/hls.js@canary"></script> --> <video id="video"></video> <script> var video = document.getElementById(‘video‘); if(Hls.isSupported()) { var hls = new Hls(); hls.loadSource(‘https://路径/index.m3u8‘); hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED,function() { video.play(); }); } else if (video.canPlayType(‘application/vnd.apple.mpegurl‘)) { video.src = ‘https://路径/index.m3u8‘; video.addEventListener(‘loadedmetadata‘,function() { video.play(); }); } </script>
ckplayer播放器播放M3U8视频
<div id="a1"></div> <script type="text/javascript" src="/ckplayer/ckplayer.js" charset="utf-8"></script> <script type="text/javascript"> var flashvars={ f:‘m3u8.swf‘, a:‘http://ztest.qiniudn.com/sintel.m3u8‘, s:4, c:0 }; var params={bgcolor:‘#FFF‘,allowFullScreen:true,allowScriptAccess:‘always‘,wmode:‘transparent‘}; var video=[‘http://ztest.qiniudn.com/sintel.m3u8‘]; CKobject.embed(‘/ckplayer/ckplayer.swf‘,‘a1‘,‘ckplayer_a1‘,‘100%‘,‘100%‘,false,flashvars,video,params); </script>
标签:ESS list ext tran tac player scree media char
原文地址:https://www.cnblogs.com/ComputerVip/p/11703333.html