From d0a918404f9be9809cd1c8a77d3d1aa701ed444a Mon Sep 17 00:00:00 2001 From: Steve Heffernan Date: Tue, 28 Oct 2014 10:20:39 -0700 Subject: [PATCH] Added doc for remaining time and removed onWaitEnd doc --- src/js/player.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/js/player.js b/src/js/player.js index 91d84a9c1..7bc2a63e0 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -459,6 +459,7 @@ vjs.Player.prototype.onWaiting = function(){ /** * A handler for events that signal that waiting has eneded * which is not consistent between browsers. See #1351 + * @private */ vjs.Player.prototype.onWaitEnd = function(){ this.removeClass('vjs-waiting'); @@ -737,7 +738,14 @@ vjs.Player.prototype.duration = function(seconds){ return this.cache_.duration || 0; }; -// Calculates how much time is left. Not in spec, but useful. +/** + * Calculates how much time is left. + * + * var timeLeft = myPlayer.remainingTime(); + * + * Not a native video element function, but useful + * @return {Number} The time remaining in seconds + */ vjs.Player.prototype.remainingTime = function(){ return this.duration() - this.currentTime(); };