diff --git a/lib/videojs-resolution-switcher.js b/lib/videojs-resolution-switcher.js index 60d45ed..7b06b64 100644 --- a/lib/videojs-resolution-switcher.js +++ b/lib/videojs-resolution-switcher.js @@ -74,7 +74,12 @@ // Change player source and wait for loadeddata event, then play video // loadedmetadata doesn't work right now for flash. // Probably because of https://github.com/videojs/video-js-swf/issues/124 - setSourcesSanitized(this.player_, this.src, this.options_.label, customSourcePicker).one('loadeddata', function() { + // If player preload is 'none' and then loadeddata not fired. So, we need timeupdate event for seek handle (timeupdate doesn't work properly with flash) + var handleSeekEvent = 'loadeddata'; + if(this.player_.preload() == 'none' && this.player_.techName_ != 'Flash') { + handleSeekEvent = 'timeupdate'; + } + setSourcesSanitized(this.player_, this.src, this.options_.label, customSourcePicker).one(handleSeekEvent, function() { this.player_.currentTime(currentTime); this.player_.handleTechSeeked_(); if(!isPaused){