我试图将BigVideo.js包含到一个div(例如英雄单位),但它继续接管身体背景.我在BigVideo.js主页上使用示例代码:
<script type="text/javascript">
var BV;
$(function() {
// initialize BigVideo
BV = new $.BigVideo();
BV.init();
BV.show('http://video-js.zencoder.com/oceans-clip.mp4',{ambient:true});
});
</script>
Run Code Online (Sandbox Code Playgroud)
我尝试过这样的事情:
<script type="text/javascript">
var BV;
$(function() {
// initialize BigVideo
BV = new $.BigVideo({
container: $('video-wrap')
});
BV.init();
BV.show('http://video-js.zencoder.com/oceans-clip.mp4',{ambient:true});
});
</script>
Run Code Online (Sandbox Code Playgroud)
Edu*_*ana 25
你需要正确指定BigVideo对象的容器(我不确定它是否是一个错字但一切似乎都好)
ID
BV = new $.BigVideo({container: $('#video-wrap')});
Run Code Online (Sandbox Code Playgroud)
类
BV = new $.BigVideo({container: $('.video-wrap')});
Run Code Online (Sandbox Code Playgroud)
在创建对象时,它设置为默认主体(BigVideo代码):
var defaults = {
// If you want to use a single mp4 source, set as true
useFlashForFirefox:true,
// If you are doing a playlist, the video won't play the first time
// on a touchscreen unless the play event is attached to a user click
forceAutoplay:false,
controls:false,
doLoop:false,
container:$('body'), //Container
shrinkable:false
};
Run Code Online (Sandbox Code Playgroud)
然后使用合并您发送的选项 $.extend()
var settings = $.extend({}, defaults, options);
Run Code Online (Sandbox Code Playgroud)