1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-04 06:48:49 +02:00

Revert "Added Flag for loop support with custom start time"

This reverts commit 120790a34a.
This commit is contained in:
Joseph Afework 2013-02-07 15:06:16 -08:00
parent 120790a34a
commit 3865d44b0e

View File

@ -11,13 +11,7 @@ goog.require('vjs.Component');
*/
vjs.Player = function(tag, options, ready){
this.tag = tag; // Store the original tag used to set options
// new flag used to determine if loop vieo is set to true,
// once the video starts options_['loop'] will always be false
// this allows the onEnded event to always be fired and alows us
// to set custom start-time on loop
var flag_loop = false;
// Set Options
// The options argument overrides options set in the video tag
// which overrides globally set options.
@ -345,40 +339,15 @@ vjs.Player.prototype.stopTrackingCurrentTime = function(){ clearInterval(this.cu
// /* Player event handlers (how the player reacts to certain events)
// ================================================================================ */
vjs.Player.prototype.onEnded = function(){
if(this.options_['start-time']!== undefined){
this.currentTime(this.options_['start-time']);
}
else{
if (this.options_['loop']) {
this.currentTime(0);
}
if (this.flag_loop) {
this.play();
this.play();
}
};
vjs.Player.prototype.onPlay = function(){
vjs.removeClass(this.el_, 'vjs-paused');
vjs.addClass(this.el_, 'vjs-playing');
// onEnded only gets fired when _options['loop'] = false || undefined && Video ends
// in order to always fire onEnded when video ends we set flag_loop = options_['loop'];
// then options_['loop'] is set to false;
// we can now use flag_loop determine if loop was ever set via data-setup array
if (this.currentTime() === 0){
if(this.options_['loop']!== undefined){
if(this.options_['loop']){
this.loop(false);
this.flag_loop = true;
}
}
if(this.options_['start-time']!== undefined){
this.currentTime(this.options_['start-time']);
}
else{
this.currentTime(0);
}
}
};
vjs.Player.prototype.onPause = function(){
@ -504,6 +473,7 @@ vjs.Player.prototype.paused = function(){
return (this.techGet('paused') === false) ? false : true;
};
// http://dev.w3.org/html5/spec/video.html#dom-media-currenttime
vjs.Player.prototype.currentTime = function(seconds){
if (seconds !== undefined) {