1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-03 00:57:02 +02:00

Don't always add controls to the video element

Fix for #1561. If the HTML tech is being constructed without a video element to work off of, make sure that the controls attribute is only added under the same circumstances it would be at player init. Before this fix, if you loaded the Flash tech and then switched to the HTML tech, you would see the native controls underneath the video.js controls.

Fix controls attribute test on iOS
iOS uses native controls by default and so was failing the assertions that native controls weren't used. Force custom controls for this test case to make it work like everywhere else.

Update nativeControlsForTouch default
The default value changed so fix the predicate that tested for whether it was in use.

closes #1811, closes #1564, closes #1561
This commit is contained in:
David LaPalomento
2014-10-03 18:24:22 -04:00
committed by heff
parent b51d83090b
commit 4bde5c8928
4 changed files with 27 additions and 5 deletions

View File

@ -58,6 +58,7 @@ vjs.Html5.prototype.createEl = function(){
var player = this.player_,
// If possible, reuse original tag for HTML5 playback technology element
el = player.tag,
attributes,
newEl,
clone;
@ -74,8 +75,15 @@ vjs.Html5.prototype.createEl = function(){
player.tag = null;
} else {
el = vjs.createEl('video');
// determine if native controls should be used
attributes = videojs.util.mergeOptions({}, player.tagAttributes);
if (!vjs.TOUCH_ENABLED || player.options()['nativeControlsForTouch'] !== true) {
delete attributes.controls;
}
vjs.setElementAttributes(el,
vjs.obj.merge(player.tagAttributes || {}, {
vjs.obj.merge(attributes, {
id:player.id() + '_html5_api',
'class':'vjs-tech'
})