video.js icon indicating copy to clipboard operation
video.js copied to clipboard

videojs disables menu links on iPad and iPhone

Open MarioBaron opened this issue 12 years ago • 11 comments

When video is located under the menu item whether its through fixed navbar like on Bootstrap videojs.com theme (screenshot attached) or under a submenu item displayed over the video. The menu links become disabled and instead trigger the control bar element to show/hide on menu item touch/click. This is pretty serious considering the iOS market share and Bootstrap theme usage (any fixed navbar for that matter). I've attached the screenshot from videojs.com where this "misbehaviour" can be observed. Hope it helps in debugging. ios simulator screen shot 9 sep 2014 11 46 49 pm

MarioBaron avatar Sep 09 '14 14:09 MarioBaron

This is because on iOS disallows event handles over a video element with native controls. On mobile, videojs currently uses native controls. When you scroll up slightly, the video element goes behind the menu bar and thus the menu bar buttons are no longer useable. I would actually consider this a bug in the website rather than in videojs.

gkatsev avatar Sep 09 '14 15:09 gkatsev

It seems to be affecting lot of themes including videojs.com...I was Googling for potential solutions but no luck, only more themes which are affected by this. Any possible workarounds/hacks/solutions on theme level that you are aware of?

MarioBaron avatar Sep 09 '14 16:09 MarioBaron

You can turn on custom controls on videojs, you can also just make sure that the video element doesn't go behind elements you want to click on.

The option is called nativeControlsForTouch and it should be false to enable the custom controls on mobile devices.

gkatsev avatar Sep 09 '14 16:09 gkatsev

Sorry for being a noob but how do I set that option? my videojs.dev.js all I am seeing is this:

    // Determine if native controls should be used
    // Our goal should be to get the custom controls on mobile solid everywhere
    // so we can remove this all together. Right now this will block custom
    // controls on touch enabled laptops like the Chrome Pixel
    if (vjs.TOUCH_ENABLED && player.options()['nativeControlsForTouch'] !== false) {
      this.useNativeControls();
    }

in video.js all I am seeing is this if(t.dc&&a.options().nativeControlsForTouch!==l) so I am a bit lost here? Thanks for responding

MarioBaron avatar Sep 09 '14 18:09 MarioBaron

videojs('my-video', {
  nativeControlsForTouch: false
});

gkatsev avatar Sep 09 '14 18:09 gkatsev

That worked for me. Thanks :+1: I am actually using a Drupal 7 module for video.js which doesn't allow an option to use data-setup at all and instead just uses data-setup "{}" empty value so i had to "hack" module output to use data-setup='{"nativeControlsForTouch": false}' so its now used for all videos on my site. Tested it on iPad,iPhone and Samsung Galaxy Android and I have to say the experience was only slightly diminished on SmartPhones because controls in vjs-control-bar are a bit small (mainly volume, fullscreen, and pause) but even that was more confined to Android as iOS devices took over once I pressed the full screen option.

I would say that Tablet devices experience was even improved with this change since there is more screen real-estate available and option to go full screen with native player is still there at least on iOS.

No change noticed for desktop. Tested with iOS Safari, Chrome or Firefox. Did not do any testing with the wretched IE so thats yet to be determined.

So not ideal but, this could easily be default option with addition of big pause button. In any case I reckon mobile users are just going to have to suck it up (thou not that much from my experience).

Unfortunately Drupal 7 video.js module hasn't really seen any commits in over a year now. But even so its turned out to be the best option for HTML5 video available. I tried MediaFront but, there was too many issues JW and flowplayer aren't exactly open source.

In any case thank you so much for all the help and big :+1: for video.js

MarioBaron avatar Sep 10 '14 08:09 MarioBaron

I have data-setup='{"nativeControlsForTouch": false}' in my videojs setup. On iPads (7), that works - the device uses the videojs controls. Unfortunately on my friend's iPhone (8), it doesn't. I'm afraid to update my iPad to 8 now.

tanuu avatar Nov 07 '14 20:11 tanuu

What's not working on the iPhone? Keep in mind on iPhones you'll only be able to see the controls when the player is inactive. Before playback you should be able to see the big play button AND the iOS play button in the middle. When you click to play the video, you should see the native controls during playback in fullscreen, but if you exit the video you should see the Video.js controls again (under the iOS big play button). I just tested on an iPhone 6 running iOS 8, and this is the exact behavior I saw.

With the iPad, you can play back a video inline using the Video.js controls, but that's simply not possible with the iPhone (thanks, Apple). Hope that clears things up for you!

mmcc avatar Nov 07 '14 20:11 mmcc

On my friend's iphone (also iOS 8), I couldn't get the videojs controls (stop, play) to respond, seems the video will only play with the utilitarian native controls. That might be OK, but it completely messes up my captions/subtitles, which I did tweaking the videojs css, On the iphone no captions appeared.

tanuu avatar Nov 08 '14 00:11 tanuu

Further to, according to JWPlayer, "Since the iPhone can only display video in full screen, this means that captions will not function on this device" (http://support.jwplayer.com/customer/portal/articles/1407438-adding-closed-captions).

tanuu avatar Nov 08 '14 00:11 tanuu

hi guys. overridenative is not working in ios browser for me. please help me?

AmirKaftari avatar May 14 '19 07:05 AmirKaftari