Jw 播放器视频无法在移动设备上自动启动

Jw player Video not auto starting on Mobile devices

您好,我正在使用 jwplayer 为我的网站生成视频。视频在网络浏览器上自动播放,但对于移动设备,它不会自动播放和加载显示。 用于设置 jwplayer 的脚本如下:

版本:6.11

播放器设置如下

_player = jwplayer('dv_VideoPlayerUrl').setup({
            'id': 'playerID',
            'width': '100%',//options.width,
            'height': '100%',// options.height,
           'file': "my .mp4 file here",
            'streamer': ((isAndroidStream) ? filePath : ''),
            'flashplayer': '../../Scripts/JWPlayer/jwplayer.flash.swf',
            'html5player': '../../Scripts/JWPlayer/jwplayer.html5.js',
            'primary': 'flash',
            'autostart': 'true',

我的视频无法在移动设备上自动播放的脚本有什么问题。

我该如何解决这个问题?

此处显示的是移动设备上的屏幕。

不建议autostart用于移动设备。

As @MisterNeutron mentioned

mobile devices won't autostart for very good reasons - expensive bandwidth, and not wanting to have a noisy video start playing while you're in a meeting, restaurant, etc. On most sites, I'd like to ban autostart videos even on desktop machines

另外移动设备不支持自动启动,见下文

How to autoplay HTML5 mp4 video on Android?

Can you autoplay HTML5 videos on the iPad?

enable-autoplay-html5-video-in-chrome

即使使用jwplayer的onReadyAPI来play()函数

jwplayer().onReady(function() { 
    jwplayer().play();
    }

如果没有 touch event 在移动设备中它将无法工作 device.There 可以解决此问题,您可以在视频播放器上提供覆盖或保留播放按钮,仅适用于用户将使用的移动设备要求点击按钮 onclick 你可以播放 jwplayer。

 $(document).ready(function() {
    $("#video1").bind("click", function() {
     jwplayer().play();
    });
}); 

不管怎样,jwplayer 本身就有这个功能,用户点击视频播放没有自动启动。

我只是为您提供多种选择,select以您的项目方便为准。