From 4e9f2eda56ca2943243c6e42aac8b20a3688ca33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ayd=C4=B1n=20Akan?= Date: Tue, 15 Dec 2015 14:38:23 +0200 Subject: [PATCH] fixed issue #18 --- lib/videojs-resolution-switcher.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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){