Flowplayer显示重叠错误

时间:2013-04-19 02:42:03

标签: jquery flowplayer

我正在尝试使用流播放器点击锚标记来加载叠加视频播放器。它给了我一个类型错误,覆盖不是一个功能。我尝试了所有可能的版本但仍然存在问题。我的HTML代码如下所示

<a href="videos/myvideo.webm" title="my video" class="video" rel="video0"><img id="clip0" src="images/icons/playClip.png"/></a>
<a href="videos/myvideo1.webm" title="my video1" class="video1" rel="video1"><img id="clip1" src="images/icons/playClip.png"/></a>

        <div id="overlay">
            <a class="close"></a>
            <div id="player">&nbsp;</div>
        </div> <!-- this is my div to where i want a modal window type video popup -->

我的javascript如下

$(function () {
var player = flowplayer("player", "js/flowplayer-3.2.16.swf"); 

$("a[rel]").overlay({
    mask: {
    color: '#000',
    opacity: 0.2
    },
    onLoad: function () {
    player.play(this.getTrigger().attr("href"));
    },
    onClose: function () {
    player.unload();
    }
});

});

任何人都可以帮忙解决这个问题吗?

TypeError: $(...).overlay is not a function
onClose: function () {

1 个答案:

答案 0 :(得分:0)

使用构造函数语法:

$f("a[rel]", "js/flowplayer-3.2.16.swf", {
    // invoked when player loads (not a clip specific event)
    onLoad: function () {
        player.play(this.getTrigger().attr("href"));
    },

    onClose: function() {
        player.unload();
    }
});

或jQuery语法:

 $("a[rel]").flowplayer("js/flowplayer-3.2.16.swf", 
    {
    // invoked when player loads (not a clip specific event)
    onLoad: function () {
        player.play(this.getTrigger().attr("href"));
        },

    onClose: function() {
        player.unload();
        } 
  })

<强>参考