From 0033246639a3d4a98f9448534efbbd675cc5c191 Mon Sep 17 00:00:00 2001 From: Kasper Moskwiak Date: Wed, 28 Oct 2015 15:18:08 +0100 Subject: [PATCH] Hide loading spinner (flash issue) --- lib/videojs-resolution-switcher.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/videojs-resolution-switcher.js b/lib/videojs-resolution-switcher.js index b23f3eb..3f0430e 100644 --- a/lib/videojs-resolution-switcher.js +++ b/lib/videojs-resolution-switcher.js @@ -43,17 +43,20 @@ }, onClick: function(){ this.onClickListener(this); - // Hide bigPlayButton - this.player_.bigPlayButton.hide(); // Remember player state var currentTime = this.player_.currentTime(); var isPaused = this.player_.paused(); this.showAsLabel(); + // Hide bigPlayButton + if(!isPaused){ + this.player_.bigPlayButton.hide(); + } // 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).one('loadeddata', function() { this.player_.currentTime(currentTime); + this.player_.handleTechSeeked_(); if(!isPaused){ // Start playing and hide loadingSpinner (flash issue ?) this.player_.play().handleTechSeeked_();