1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-15 10:39:58 +02:00

Added history and logging.

This commit is contained in:
Steve Heffernan 2010-10-21 21:44:58 -07:00
parent 8eedbe6a38
commit e9ba8f3792
2 changed files with 18 additions and 13 deletions

View File

@ -11,7 +11,7 @@
// Must come after the video.js library
// Add VideoJS to all video tags on the page when the DOM is ready
VideoJS.setupAllWhenReady();
VideoJS.setupAllWhenReady({ debug: true });
/* ============= OR ============ */

View File

@ -553,7 +553,7 @@ var VideoJS = JRClass.extend({
// When the video is played
onPlay: function(event){
console.log("onPlay");
this.log("onPlay");
this.hasPlayed = true;
this.playControl.className = "vjs-play-control vjs-pause";
this.hidePoster();
@ -581,47 +581,46 @@ var VideoJS = JRClass.extend({
},
onError: function(event){
console.log(event);
console.log(this.video.error);
this.log(this.video.error);
},
onLoadedData: function(event){
console.log("loaded")
this.log("loaded")
this.hideSpinner();
},
onSeeking: function(event){
this.showSpinner();
console.log("Seeking");
this.log("Seeking");
},
onSeeked: function(event){
this.hideSpinner();
console.log("Seeked");
this.log("Seeked");
},
onWaiting: function(event){
this.showSpinner();
console.log("waiting");
this.log("waiting");
},
onStalled: function(event){
this.showSpinner();
console.log("waiting");
this.log("waiting");
},
onLoadStart: function(event){
this.showSpinner();
console.log("loadstart");
this.log("loadstart");
},
onCanPlay: function(event){
this.hideSpinner();
console.log("CanPlay");
this.log("CanPlay");
},
onCanPlayThrough: function(event){
console.log("CanPlayThrough");
this.log("CanPlayThrough");
},
// When the video's load progress is updated
@ -1005,7 +1004,7 @@ var VideoJS = JRClass.extend({
this.subtitles[x].showing = true;
}
}
}
},
/* Device Fixes
@ -1031,6 +1030,12 @@ var VideoJS = JRClass.extend({
// }
// }
history: [],
log: function(text){
if (this.options.debug === true) { console.log(text); }
if (this.history.length >= 50) { this.history.shift(); }
}
});
////////////////////////////////////////////////////////////////////////////////