在FancyBox内加载JW Player [英] Loading JW Player Inside of FancyBox
问题描述
伙计,我觉得我已经接近了,但是没有奖品.这是我用来加载Fancybox的代码,我正试图通过这些代码来加载JW Player.
Folks, I feel like I'm close, but no prize. Here's the code that I'm using to load a Fancybox and through which I am attempting to load JW Player.
<script type="text/javascript">
jQuery(window).load(function() {
jQuery("a.fancybox").fancybox({
'content':'<div id="mediaspace">Test</div>',
maxWidth : 800,
maxHeight : 600,
fitToView : false,
width : '70%',
height : '70%',
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',
afterLoad: function() {
jwplayer('mediaspace').setup({
'flashplayer': '<?php bloginfo('template_directory'); ?>/lib/jw/player.swf',
'file': 'LtGoBZ4D4_E',
'image': 'http://img.youtube.com/vi/LtGoBZ4D4_E/0.jpg',
'provider': 'youtube',
'height': 400,
'width': 700,
'controlbar.position': 'bottom',
'youtube.quality': 'highres'
});
}
});
});
</script>
请原谅代码格式,我一直在尝试许多不同的选项.
Please forgive the code formatting, I've been experimenting with a lot of different options.
JW Player 做在fancybox之外工作.有什么想法或替代方法来解决问题?
JW Player does work outside of fancybox. Any ideas or alternate ways of looking at the problem?
推荐答案
fancybox插件没有固有的需要加载"的图像或视频,因此不会触发afterLoad回调.代替:
The afterLoad callback doesn't fire because there is no image or video inherent to the fancybox plugin that would need to "load". Instead of:
afterLoad: function() {
使用:
afterShow: function() {
那将解决您的问题.
此处是文档的链接,以供进一步参考或将来对API进行更改: http://fancyapps.com/fancybox/
Here is a link to the documentation for further reference or future API changes: http://fancyapps.com/fancybox/
这篇关于在FancyBox内加载JW Player的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!