mirror of
https://github.com/videojs/video.js.git
synced 2025-04-15 11:56:32 +02:00
Fixed spinner when Safari calls waiting and doesn't resolve.
This commit is contained in:
parent
1138ffae7d
commit
e8e0306415
@ -134,6 +134,7 @@ Changelog
|
|||||||
- Feature: Added loading spinner.
|
- Feature: Added loading spinner.
|
||||||
- Feature: Added volume() function to get and set volume through the player.
|
- Feature: Added volume() function to get and set volume through the player.
|
||||||
- Fix: Fix issue where FF would loop video in background when ended.
|
- Fix: Fix issue where FF would loop video in background when ended.
|
||||||
|
- Fix: Bug in Chrome that shows poster & plays audio if you set currentTime too quickly.
|
||||||
|
|
||||||
1.1.3
|
1.1.3
|
||||||
|
|
||||||
|
19
video.js
19
video.js
@ -131,14 +131,10 @@ var VideoJS = JRClass.extend({
|
|||||||
this.video.addEventListener('progress', this.onProgress.context(this), false);
|
this.video.addEventListener('progress', this.onProgress.context(this), false);
|
||||||
// Set interval for load progress using buffer watching method
|
// Set interval for load progress using buffer watching method
|
||||||
this.watchBuffer = setInterval(this.updateBufferedTotal.context(this), 33);
|
this.watchBuffer = setInterval(this.updateBufferedTotal.context(this), 33);
|
||||||
// Listen for Video time update
|
|
||||||
this.video.addEventListener('timeupdate', this.onTimeUpdate.context(this), false);
|
this.video.addEventListener('timeupdate', this.onTimeUpdate.context(this), false);
|
||||||
|
|
||||||
// When seeking occurs
|
|
||||||
this.video.addEventListener("seeking", this.onSeeking.context(this), false);
|
this.video.addEventListener("seeking", this.onSeeking.context(this), false);
|
||||||
// When seeking has ended
|
|
||||||
this.video.addEventListener("seeked", this.onSeeked.context(this), false);
|
this.video.addEventListener("seeked", this.onSeeked.context(this), false);
|
||||||
|
|
||||||
this.video.addEventListener("canplay", this.onCanPlay.context(this), false);
|
this.video.addEventListener("canplay", this.onCanPlay.context(this), false);
|
||||||
this.video.addEventListener("canplaythrough", this.onCanPlayThrough.context(this), false);
|
this.video.addEventListener("canplaythrough", this.onCanPlayThrough.context(this), false);
|
||||||
this.video.addEventListener("playing", this.onPlaying.context(this), false);
|
this.video.addEventListener("playing", this.onPlaying.context(this), false);
|
||||||
@ -286,6 +282,7 @@ var VideoJS = JRClass.extend({
|
|||||||
setTimeout(this.loadInterface.context(this),0);
|
setTimeout(this.loadInterface.context(this),0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log(100)
|
||||||
}
|
}
|
||||||
this.positionBox();
|
this.positionBox();
|
||||||
if(this.video.paused !== false) { this.showBigPlayButton(); }
|
if(this.video.paused !== false) { this.showBigPlayButton(); }
|
||||||
@ -411,8 +408,8 @@ var VideoJS = JRClass.extend({
|
|||||||
clearInterval(this.spinnerInterval);
|
clearInterval(this.spinnerInterval);
|
||||||
this.spinnerInterval = setInterval(function(){ this.rotateSpinner(); }.context(this), 100);
|
this.spinnerInterval = setInterval(function(){ this.rotateSpinner(); }.context(this), 100);
|
||||||
},
|
},
|
||||||
hideSpinner: function(){
|
hideSpinner: function(){
|
||||||
this.spinner.style.display = "none";
|
this.spinner.style.display = "none";
|
||||||
clearInterval(this.spinnerInterval);
|
clearInterval(this.spinnerInterval);
|
||||||
},
|
},
|
||||||
spinnerRotated: 0,
|
spinnerRotated: 0,
|
||||||
@ -613,6 +610,8 @@ var VideoJS = JRClass.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onWaiting: function(event){
|
onWaiting: function(event){
|
||||||
|
// Safari sometimes triggers waiting in appropriately
|
||||||
|
// Like after video has played, any you play again.
|
||||||
this.showSpinner();
|
this.showSpinner();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -630,7 +629,7 @@ var VideoJS = JRClass.extend({
|
|||||||
onCanPlayThrough: function(event){
|
onCanPlayThrough: function(event){
|
||||||
this.hideSpinner();
|
this.hideSpinner();
|
||||||
},
|
},
|
||||||
|
|
||||||
onPlaying: function(event){
|
onPlaying: function(event){
|
||||||
this.hideSpinner();
|
this.hideSpinner();
|
||||||
},
|
},
|
||||||
@ -997,6 +996,10 @@ var VideoJS = JRClass.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onTimeUpdate: function(){
|
onTimeUpdate: function(){
|
||||||
|
|
||||||
|
// Safari sometimes calls waiting and doesn't recover
|
||||||
|
// if(this.spinner.style.display == "block") { this.hideSpinner(); }
|
||||||
|
|
||||||
// show the subtitles
|
// show the subtitles
|
||||||
if (this.subtitles) {
|
if (this.subtitles) {
|
||||||
var x = this.currentSubtitlePosition;
|
var x = this.currentSubtitlePosition;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user