1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-12 11:15:04 +02:00

Merge pull request #368 from dmlap/issue367

Fixes #367
This commit is contained in:
Steve Heffernan 2013-03-08 14:45:18 -08:00
commit de5acf4fe7
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']);
});