gpt4 book ai didi

javascript - facebook 嵌入式视频 api 是否仍然支持 removeListener()?

转载 作者:行者123 更新时间:2023-11-30 00:05:21 25 4
gpt4 key购买 nike

根据 facebook 文档 - https://developers.facebook.com/docs/plugins/embedded-video-player/api , 我们订阅玩家事件

    var handleDesktopEvents = function (msg) {
if (msg.type === 'video') {
var player = msg.instance;
var playHandler = player.subscribe('startedPlaying', function() {
// Video started playing ...
player.unmute();
console.log('detected video playing');
ga_virtual_pagehit(msg.id);
console.log('sent event to GA');
playHandler.removeListener('startedPlaying');
// playHandler.release();
});
console.log('detected video ready');
player.play();
FB.Event.unsubscribe('xfbml.ready', handleDesktopEvents, handleDesktopEx);
}
};
var handleDesktopEx = function () {
// Handle pause() and exceptions
console.log('detected pause');
};

FB.Event.subscribe('xfbml.ready', handleDesktopEvents, handleDesktopEx);

似乎 removeListener()subscribe() 返回的 token 上不可用。通过调试器,我们看到 token 上有一个方法 release() 可用。应该这样用吗?现在正式了吗?

我做错了什么吗?

最佳答案

除非 FB 再次改变某些东西,否则可能仍然是 release() 方法。它做了 removeListen() 应该做的事情。

关于javascript - facebook 嵌入式视频 api 是否仍然支持 removeListener()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38745635/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com