Skip to content

Commit

Permalink
create player instance from component
Browse files Browse the repository at this point in the history
to allow to extend player class
  • Loading branch information
adam187 committed Jul 25, 2016
1 parent fc72fb9 commit 93371f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ function videojs(id, options, ready){
throw new TypeError('The element or ID supplied is not valid. (videojs)'); // Returns
}

const PlayerComponent = Component.getComponent('Player');
// Element may have a player attr referring to an already created player instance.
// If not, set up a new player and return the instance.
return tag['player'] || Player.players[tag.playerId] || new Player(tag, options, ready);
return tag['player'] || Player.players[tag.playerId] || new PlayerComponent(tag, options, ready);
}

// Add default styles
Expand Down

0 comments on commit 93371f5

Please sign in to comment.