Merge branch 'bug-player-not-ready'

This commit is contained in:
Kasper Moskwiak 2015-10-29 21:20:36 +01:00
commit 1c0ba26e3e

View file

@ -4,6 +4,9 @@
* Licensed under the Apache-2.0 license. */
(function() {
/* jshint eqnull: true*/
/* global require */
'use strict';
var videojs = null;
if(typeof window.videojs === 'undefined' && typeof require === 'function') {
videojs = require('videojs');
@ -12,8 +15,7 @@
}
(function(window, videojs) {
/* jshint eqnull: true*/
'use strict';
var defaults = {},
videoJsResolutionSwitcher;
@ -224,7 +226,10 @@
// Create resolution switcher for videos form <source> tag inside <video>
if(player.options_.sources.length > 1){
player.updateSrc(player.options_.sources);
// Wait for player ready event
player.ready(function(){
player.updateSrc(player.options_.sources);
});
}
};