Search code examples
ipadjplayer

JQuery jPlayer autoplay not working on ipad how to show controls


I am using jPlayer to play video on webpage to make it compatible for desktop browsers and iPad.

I am using the following code

$("#jquery_videoPlayer").jPlayer({
    ready: function () {
        $(this).jPlayer("setMedia", {
            m4v: _mp4url,
            ogv: _oggurl,
            webmv: _webmurl,
            flv:_url
        }).jPlayer("play");
    },
    swfPath: "../js",
    supplied: "m4v, webmv, ogv, flv",
    preload:"auto",
    loop:true,
    solution: "html, flash",
    size: {
        width: "256px",
        height: "240px"
    }
});

It works fine on all browsers however since iPad do not allow autoplay the video I need to show play button on the video (HTML5).

I could not find any option for this in the document.

Can someone help me to what changes should I make in the code to display HTML5 play button on video for jPlayer.

Thanks for any help.


Solution

  • nativeVideoControls is an object conatining multiple regex values, matched against the browser's user-agent. add this to your options. here are some examples.

    nativeVideoControls: {
      ipad: /ipad/,
      iphone: /iphone/,
      android: /android/,
      blackberry: /blackberry/,
      iemobile: /iemobile/
    },