为什么JWPlayer只在iphone中没有声音?

时间:2017-10-02 12:54:28

标签: javascript frontend jwplayer

我遇到了JW PLAYER的问题,只有iPHONE Mobile才有声音

$.ajax({
    type: 'GET',
    url: "{{url('xxxx')}}"+'/'+id,
    dataType: 'json',
    success: function (data) {

        player.setup({
            "sharing": {
                "sites": ["reddit","facebook","twitter"]
            },

            autostart: true,
            mute: false,

            cast:{ },
            skin: {
                name: "six"
            },
            width:"100%",
            aspectratio: "16:9",

            playlist: [{
                tracks: data.subtitles,
                image: data.image,
                sources:data.sources
            }],
        });
    }
});

player.on('ready', function(event){
    var toggle=$('.share-button');
    sharingPlugin = jwplayer().getPlugin('sharing');
    sharingPlugin.on('open',function(){
        toggle.attr('status','1');
    });

    sharingPlugin.on('close',function(){
        toggle.attr('status','0');
    })

});

jwplayer().on('ready',function(){jwplayer().setCurrentQuality(2)});

1 个答案:

答案 0 :(得分:0)

浏览器要求播放器静音,以便媒体在移动设备上自动播放。这里的博客文章更详细地描述了这一要求:

https://www.jwplayer.com/blog/mobile-web-autoplay/