Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VideoJS 4 native controls now default on mobile?

I am adapting my resolution switching work for Vidcaster on VideoJS into a plugin (see https://github.com/videojs/video.js/pull/233).

In VideoJS 3.2 the VideoJS controls were active on mobile platforms such as Android and iOS. Now when I boot up version 4 it appears the native controls take precedence. This means that features that require actions on control bar buttons such as tracks, etc are not accessible, correct?

We would like to continue to present a resolution switching button to our mobile users. Was the decision to defer to the native controls an intentional philosophical one? If so, where in the code does this decision happen? I have been digging for it for a while now.

Much appreciated.

like image 687
onyxrev Avatar asked May 22 '13 16:05

onyxrev


2 Answers

According to the source the native controls are default on iOS and Android "until controls are more stable on those devices".

<video data-setup='{"customControlsOnMobile": true}' … would enable the video.js controls, but bear in mind they're disabled for a reason.

Update: This question and answer relate to video.js 4. For video.js 5 the equivalent is nativeControlsForTouch: false. Native controls are always used on iPhone and older versions of Android known to be problematic with custom controls.

like image 199
misterben Avatar answered Nov 15 '22 18:11

misterben


Currently the option to initialize a video that will display videojs' custom controls and not the native controls (iOS, for example) is nativeControlsForTouch: false. Can be found in the source here. This option can be set as stated in the answer above through <video data-setup='{"nativeControlsForTouch": false}' … or through JavaScript: vjs('video_id', {nativeControlsForTouch: false});

like image 22
jweidler Avatar answered Nov 15 '22 18:11

jweidler