YouTube API不在Safari中静音(不是iOS) [英] YouTube API Not Muting in Safari (not iOS)

查看:144
本文介绍了YouTube API不在Safari中静音(不是iOS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用下面的代码初始化了我的播放器。它在Chrome,FireFox和IE中都很好,但不是Safari。有什么想法吗?

I have initialized my player with the code below. It mutes fine in Chrome, FireFox, and IE, but not Safari. Any thoughts amigos?

function onYouTubeIframeAPIReady() {
    player = new YT.Player('iframe-wrapper', {
        height: videoHeight,
        width: videoWidth,
        videoId: id,
        events: {
            'onReady': onPlayerReady
        },
        playerVars: {
            'autoplay': 1,
            'controls': 0,
            'autohide': 1,
            'wmode': 'opaque',
            'showinfo': 0,
            'loop': 1,
            'mute': 1
        }
    });
}
  function onPlayerReady() {
    player.mute();
    player.playVideo();
}


推荐答案

问题最终成为了那个问题onPlayerReady事件未触发。显然,这是一个已知问题,并且在YouTube API中没有很好的文档记录。 这是答案的链接

The problem ended up being that the onPlayerReady event wasn't firing. Apparently this is somewhat of a known issue and isn't terribly well documented in the YouTube API. Here's a link to the answer.

这篇关于YouTube API不在Safari中静音(不是iOS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆