我的Html代碼如下,這個網頁在本地打開能播放視頻,但是上傳到服務器上播放不了。
請問如何解決?
<!DOCTYPE html>
<head>
<title>videoJs</title>
<link href="https://vjs.zencdn.net/7.5.5/video-js.css" rel="stylesheet" />
<script src="https://vjs.zencdn.net/7.5.5/video.js"></script>
<script src="https://unpkg.com/videojs-contrib-hls/dist/videojs-contrib-hls.js"></script>
</head>
<body>
<section id="videoPlayer">
<video id="example-video" width="600" height="300" class="video-js vjs-default-skin vjs-big-play-centered" poster="">
<source src="http://liveplay-kk.rtxapp.com/live/program/live/hddfws/4000000/mnf.m3u8" type="application/x-mpegURL" id="target">
</video>
</section>
<script type="text/javascript">
var player = videojs('example-video', {
"poster": "",
"controls": "true"
}, function() {
this.on('play', function() {
console.log('正在播放');
});
//暫停--播放完畢后也會暫停
this.on('pause', function() {
console.log("暫停中")
});
// 結束
this.on('ended', function() {
console.log('結束');
})
});
</script>
</body>
</html>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/159948.html
標籤:JavaScript
