mirror of
https://github.com/videojs/video.js.git
synced 2024-12-02 09:11:54 +02:00
Changed 'firstplay' to match event functions
Changed the 'firstplay' method to the same form as the other event functions
This commit is contained in:
parent
3353b75327
commit
e23cf4a1c0
@ -48,20 +48,12 @@ vjs.Player = function(tag, options, ready){
|
||||
|
||||
this.on('ended', this.onEnded);
|
||||
this.on('play', this.onPlay);
|
||||
this.on('firstplay', this.onFirstPlay);
|
||||
this.on('pause', this.onPause);
|
||||
this.on('progress', this.onProgress);
|
||||
this.on('durationchange', this.onDurationChange);
|
||||
this.on('error', this.onError);
|
||||
|
||||
//If the first starttime attribute is specified
|
||||
//then we will start at the given offset in seconds
|
||||
|
||||
this.on('firstplay',function(){
|
||||
if(this.options_['starttime']){
|
||||
this.currentTime(this.options_['starttime']);
|
||||
}
|
||||
});
|
||||
|
||||
// Make player easily findable by ID
|
||||
vjs.players[this.id_] = this;
|
||||
};
|
||||
@ -359,6 +351,14 @@ vjs.Player.prototype.onPlay = function(){
|
||||
vjs.addClass(this.el_, 'vjs-playing');
|
||||
};
|
||||
|
||||
vjs.Player.prototype.onFirstPlay = function(){
|
||||
//If the first starttime attribute is specified
|
||||
//then we will start at the given offset in seconds
|
||||
if(this.options_['starttime']){
|
||||
this.currentTime(this.options_['starttime']);
|
||||
}
|
||||
};
|
||||
|
||||
vjs.Player.prototype.onPause = function(){
|
||||
vjs.removeClass(this.el_, 'vjs-playing');
|
||||
vjs.addClass(this.el_, 'vjs-paused');
|
||||
|
Loading…
Reference in New Issue
Block a user