javascript - fancybox 中的 Flowplayer?

标签 javascript fancybox flowplayer

我试图让 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/

相关文章:

javascript - 如何在Javascript的for循环中使用变量?

javascript - Fancybox 的多个实例的自定义样式

html - 如何使用 Fancybox 在一页上制作多个画廊?

asp.net - 如何在 IIS 中启用字节范围的 http 请求

javascript - 如何在 React Native 中点击不同页面上的按钮?

javascript - 使用 JQuery/CSS 动画增加 div 的大小

javascript - 用于将图像显示到 Canvas 的简单 Websocket

javascript - fancybox 使鼠标滚轮淡入图片水平

javascript - Flowplayer:如何解绑事件?

javascript - 剪辑中指定的 Flowplayer Provider 未加载