gpt4 book ai didi

jquery - 如何在 div 中使用 BigVideo.js?

转载 作者:行者123 更新时间:2023-11-28 21:38:53 25 4
gpt4 key购买 nike

我试图将 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>

我试过这样做:

  <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>

最佳答案

您需要正确指定 BigVideo 对象的容器(我不确定这是不是打字错误,但一切似乎都正常)

身份证

BV = new $.BigVideo({container: $('#video-wrap')});

BV = new $.BigVideo({container: $('.video-wrap')});

在创建对象时它设置为默认主体(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
};

然后使用 $.extend() 合并您发送的选项

var settings = $.extend({}, defaults, options);

关于jquery - 如何在 div 中使用 BigVideo.js?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22770690/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com