0

我正在尝试使用流播放器单击锚标记以加载覆盖视频播放器。它给了我一个类型错误,即覆盖不是一个函数。我尝试了所有可能的版本,但问题仍然存在。我的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 () {
4

1 回答 1

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();
        } 
  })

参考

于 2014-10-16T01:00:41.780 回答