Merge branch 'aydinkn-preload-fix'

This commit is contained in:
Kasper Moskwiak 2015-12-19 18:45:55 +01:00
commit aacc474524

View file

@ -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){