1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-27 02:43:45 +02:00
If you are quick, you could get videojs to wrap the HTML video element twice on iOS. The video element has to be recreated after moving on iOS but we weren't re-associating it with the player object. When autoSetup swung through, it would re-initialize the video element and create a player within a player.
This commit is contained in:
David LaPalomento 2013-03-07 20:57:52 -05:00
parent bc723acb06
commit 0ba7166636
3 changed files with 23 additions and 1 deletions

View File

@ -23,7 +23,7 @@ vjs.Component = function(player, options, ready){
this.name_ = options['name'] || null;
// Create element if one wasn't provided in potions
// Create element if one wasn't provided in options
this.el_ = options['el'] || this.createEl();
this.children_ = [];

View File

@ -68,6 +68,9 @@ vjs.Html5.prototype.createEl = function(){
className:'vjs-tech'
});
}
// associate the player with the new tag
el['player'] = player;
vjs.insertFirst(el, player.el());
}

View File

@ -16,3 +16,22 @@ test('should detect whether the volume can be changed', function(){
ok(!vjs.Html5.canControlVolume());
vjs.TEST_VID = testVid;
});
test('should re-link the player if the tech is moved', function(){
var player, tech, el;
el = document.createElement('div');
el.innerHTML = '<div />';
player = {
id: function(){ return 'id'; },
el: function(){ return el; },
options_: {},
ready: function(){}
};
tech = new vjs.Html5(player, {});
tech.features = {
movingMediaElementInDOM: false
};
tech.createEl();
strictEqual(player, tech.el().player);
});