我想从网址动态加载视频js,但它无效。
var container = document.getElementById("my_video_1");
videojs(container, {
controls: true,
class:'video-js vjs-default-skin',
techOrder: ["html5", "flash"],
source: [{
type : 'video/mp4',
src : 'http://vjs.zencdn.net/v/oceans.mp4'
}]
}, function() {
});
<script src="https://raw.githubusercontent.com/CharlotteDunois/videojs-loopbutton/master/videojs.loopbutton.min.js"></script>
<link href="https://raw.githubusercontent.com/CharlotteDunois/videojs-loopbutton/master/videojs.loopbutton.css" rel="stylesheet"/>
<link href="http://vjs.zencdn.net/4.11/video-js.css" rel="stylesheet"/>
<script src="http://vjs.zencdn.net/4.11/video.js"></script>
<video id="my_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268"
data-setup='{ "playbackRates": [0.5, 1, 1.5, 2],"loopbutton": true }'
>
</video>
JSFIDDLE:http://jsfiddle.net/hiteshbhilai2010/0a5u3ew4/332/(动态添加网址 - 不起作用)
JSFIDDLE:http://jsfiddle.net/hiteshbhilai2010/0a5u3ew4/334/(在HTML中添加的URL - Works)
此answer对我不起作用。有人可以提供帮助。谢谢!!!
答案 0 :(得分:0)