From e23cf4a1c047262e5323a4950ec4ee1791434298 Mon Sep 17 00:00:00 2001 From: Joseph Afework Date: Sun, 10 Feb 2013 22:45:00 -0800 Subject: [PATCH] Changed 'firstplay' to match event functions Changed the 'firstplay' method to the same form as the other event functions --- src/js/player.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/js/player.js b/src/js/player.js index 0ff14e3b9..79bdcc5c0 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -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');