0

JW player, if you hide the control bar you can click the video to play and pause, this works fine in desktop.

When I tested this in ipad it plays but touching it again doesn't pause the video.

Verify with this URL, https://support.jwplayer.com/customer/portal/articles/1406723-basic-video-embed

**Dont use the control bar as I need it disabled.

Sunny
  • 863
  • 9
  • 10

2 Answers2

2

If you hide the JW controls, then the player should also not react to clicking on the video as a means to start/stop unless you specifically add code to tell it to.

For this to happen you need to attach a function to the onDisplayClick event listener as follows:

**JW6 version**
jwplayer().onDisplayClick(function(){
    jwplayer().play();
});

**JW7 version**
jwplayer().on('displayClick',function(){
    jwplayer().play();
});

Just calling the play() method in this way will handle the toggle of play/pause states - you don't need to manage this yourself.

jherrieven
  • 425
  • 2
  • 5
  • Hi, I was pretty sure that JW Team has some function inbuilt for this but I was not getting that. Your answer looks neater and proper, but I am not able to make it work on IOS, Ipad. Have you tried it on any IOS? – Sunny Jan 20 '16 at 10:07
  • Yes, iPad Mini 2 with iOS9.2 works fine. Check this example here: [Example for sunnyuff](http://dev.powered-by-haiku.co.uk/debug/sunnyuff/). Which versions of iOS & JW Player are you dealing with? – jherrieven Jan 20 '16 at 11:12
0

I tried to do it in proper way but that doesn't seem to work alright, this is the only solution works for me,

$('.video-wrapper').on({ 'touchend' : 
                    function(){
                        if(dtjwplayer.getState() !== 'paused') {
                            dtjwplayer.pause(true); 
                        }
                    } 
                });

This is a very basic requirement where people wants to disable the control bar, Please let me know if there is any better way to do it.

Sunny
  • 863
  • 9
  • 10