From 93371f5faa48911d7725c54b65d84071fed89b35 Mon Sep 17 00:00:00 2001 From: Adam Misiorny Date: Fri, 22 Jul 2016 18:54:18 +0200 Subject: [PATCH] create player instance from component to allow to extend player class --- src/js/video.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/video.js b/src/js/video.js index e9ac832f47..7ecf2ec0f0 100644 --- a/src/js/video.js +++ b/src/js/video.js @@ -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