mirror of
https://github.com/videojs/video.js.git
synced 2024-12-27 02:43:45 +02:00
Merge branch 'master' of github.com:zencoder/video-js
This commit is contained in:
commit
8bc5fb055e
@ -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_ = [];
|
||||
@ -288,8 +288,8 @@ vjs.Component.prototype.addChild = function(child, options){
|
||||
|
||||
// Add the UI object's element to the container div (box)
|
||||
// Having an element is not required
|
||||
if (typeof component.el === 'function' && component.el()) {
|
||||
this.el_.appendChild(component.el());
|
||||
if (typeof component['el'] === 'function' && component['el']()) {
|
||||
this.el_.appendChild(component['el']());
|
||||
}
|
||||
|
||||
// Return so it can stored on parent object if desired.
|
||||
|
@ -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