mirror of
https://github.com/kmoskwiak/videojs-resolution-switcher.git
synced 2025-10-03 01:39:19 +02:00
Merge branch 'bug-player-not-ready'
This commit is contained in:
commit
1c0ba26e3e
1 changed files with 8 additions and 3 deletions
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue