我正在尝试让Flowplayer显示在Fancybox中,但不能完全让它工作。这是到目前为止我的代码;
$("a.video_link").click(function () {
$.fancybox({
'autoScale': false,
'transitionIn': 'none',
'transitionOut': 'none',
'title': this.title,
'width': 680,
'height': 495,
'href': '/flowplayer/flowplayer.swf?video=myvideo.flv', /* have also tried a couple of other options for the url settings, but without luck)
'type': 'swf',
'swf': {
'wmode': 'transparent',
'allowfullscreen': 'true'
}
});
return false;
});有什么建议吗?
发布于 2011-07-02 04:54:31
尝试手动启动fancybox并将其内容设置为flowplayer。例如,给定链接:
<a href="http://pseudo01.hddn.com/vod/demo.flowplayervod/flowplayer-700.flv"
class="videoLink">Demo</a>创建一个JQuery点击函数,如下所示:
$('a.videoLink').click(function(e) {
e.preventDefault();
var container = $('<div/>');
container.flowplayer(
'http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf',
$(this).attr('href')
);
$.fancybox({
content: container,
width: 300, height: 200,
scrolling: 'no',
autoDimensions: false
});
});请注意,默认情况下,flowplayer占用其容器的大小,因此必须为其提供有限的尺寸才能正确地查看它。
发布于 2010-06-03 05:16:22
你有没有尝试过用jQuery在SWF对象上创建,从而设置swf参数,然后使用flow players内容设置直接设置模型的html。
还可以尝试检查您的调试窗口,看看是否有任何错误出现。
-- E.G
var flashvars = { //Change this with $.extend within click callback if you need to!
file : 'yvideo.flv'
}
var flowBoxParams = {
'autoScale': false,
'transitionIn': 'none',
'transitionOut': 'none',
'width': 680,
'height': 495,
}
var $conatiner = $('<div></div>').attr('id','MediaPlayerHolder').hide();
swfobject.embedSWF("/flowplayer/flowplayer.swf","MediaPlayerHolder","300","120","9.0.0",flashvars,params,attributes);
$("a.video_link").click(function(){
//Merge basic settings with title
params = $.extend(flowBoxParams,{title:this.title,html:$container});
//Send object to FlowPlay
$.fancybox(params);
//Show the video play
$($container).show();
});THis基本上就是使用默认设置(flashvars,flowBoxParams)设置变量,创建一个id为(MediaPlayerHolder)的空div容器,并将其设置为display:none。
然后我们用swfObject创建一个基本的flash元素,也就是你的flowplayer swf,并将它分配给隐藏的div容器。
然后,我们等待用户点击被激活,然后修改默认设置,将title值添加到flowplayer选项中。
然后我们告诉flow player开始它需要做的事情。
使用thin改变容器的可见性。
这是未经测试的,但如果这里有任何错误,他们应该只是次要的,除非流程是严格的,当涉及到加载swf将自己。
发布于 2012-02-22 00:28:53
我做了很多次,唯一能让它工作的方法就是这么做,
JavaScript >>
flowplayer(".player", "http://www2.imperial.ac.uk/business-school/etu/courses_1112/common/scripts/flowplayer/flowplayer-3.2.7.swf");
$('.yourbox').fancybox();超文本标记语言>>
<a class="yourbox" href="#data" >This shows content of element who has id="data"</a>
<div style="display:none">
<div id="data">
<a href="http://helix.imperial.ac.uk/bsflash/courses/finance_group/ethics/icm.mp4" style="display:block;width:640px;height:360px" class="player"></a>
</div>
</div>如果你这样做,你将需要在关闭盒子的时候把一个ie hack也放进去,来卸载玩家。
https://stackoverflow.com/questions/2961626
复制相似问题