From 4fa6a942d9cfa60db8f93e75033672a9b56c152d Mon Sep 17 00:00:00 2001 From: Brandon Bay Date: Wed, 29 Apr 2015 10:15:15 -0700 Subject: [PATCH] @bc-bbay Load plugins before controls. closes #2094 --- CHANGELOG.md | 1 + src/js/player.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d0a16b4c..8c21bf5bb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ CHANGELOG * @forbesjo added the `scrubbing` property ([view](/~https://github.com/videojs/video.js/pull/2080)) * @heff switched to border-box sizing for all player elements ([view](/~https://github.com/videojs/video.js/pull/2082)) * @forbesjo added a vjs-button class to button controls ([view](/~https://github.com/videojs/video.js/pull/2084)) +* @bc-bbay Load plugins before controls ([view](/~https://github.com/videojs/video.js/pull/2094)) -------------------- diff --git a/src/js/player.js b/src/js/player.js index 72dcbed13d..563d687c07 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -108,6 +108,14 @@ class Player extends Component { this.scrubbing_ = false; this.el_ = this.createEl(); + + // Load plugins + if (options['plugins']) { + Lib.obj.each(options['plugins'], function(key, val){ + this[key](val); + }, this); + } + this.initChildren(); // Set isAudio based on whether or not an audio tag was used @@ -138,12 +146,6 @@ class Player extends Component { // Make player easily findable by ID Player.players[this.id_] = this; - if (options['plugins']) { - Lib.obj.each(options['plugins'], function(key, val){ - this[key](val); - }, this); - } - // When the player is first initialized, trigger activity so components // like the control bar show themselves if needed this.userActive_ = true;