mirror of
https://github.com/videojs/video.js.git
synced 2024-12-12 11:15:04 +02:00
commit
de5acf4fe7
@ -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_ = [];
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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']);
|
||||
});
|
Loading…
Reference in New Issue
Block a user