Hide loading spinner (flash issue)

This commit is contained in:
Kasper Moskwiak 2015-10-28 15:18:08 +01:00
parent 5858c346b8
commit 0033246639

View file

@ -43,17 +43,20 @@
}, },
onClick: function(){ onClick: function(){
this.onClickListener(this); this.onClickListener(this);
// Hide bigPlayButton
this.player_.bigPlayButton.hide();
// Remember player state // Remember player state
var currentTime = this.player_.currentTime(); var currentTime = this.player_.currentTime();
var isPaused = this.player_.paused(); var isPaused = this.player_.paused();
this.showAsLabel(); this.showAsLabel();
// Hide bigPlayButton
if(!isPaused){
this.player_.bigPlayButton.hide();
}
// Change player source and wait for loadeddata event, then play video // Change player source and wait for loadeddata event, then play video
// loadedmetadata doesn't work right now for flash. // loadedmetadata doesn't work right now for flash.
// Probably because of https://github.com/videojs/video-js-swf/issues/124 // Probably because of https://github.com/videojs/video-js-swf/issues/124
setSourcesSanitized(this.player_, this.src).one('loadeddata', function() { setSourcesSanitized(this.player_, this.src).one('loadeddata', function() {
this.player_.currentTime(currentTime); this.player_.currentTime(currentTime);
this.player_.handleTechSeeked_();
if(!isPaused){ if(!isPaused){
// Start playing and hide loadingSpinner (flash issue ?) // Start playing and hide loadingSpinner (flash issue ?)
this.player_.play().handleTechSeeked_(); this.player_.play().handleTechSeeked_();