我试图让 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;
});
有什么建议吗?
最佳答案
尝试手动启动 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 会占用其容器的大小,因此必须指定有限的尺寸才能正确查看它。
关于javascript - fancybox 中的 Flowplayer?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2961626/