diff --git a/AUTHORS b/AUTHORS index 27a3699019..10f7ba5ca9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -23,3 +23,5 @@ Sanborn Hilland TalkTalk Plc <*@talktalkplc.com> uStudio Inc. <*@ustudio.com> Philo Inc. <*@philo.com> +Itay Kinnrot + diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 5efed36289..717f456036 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -38,3 +38,4 @@ Timothy Drews Vasanth Polipelli Vignesh Venkatasubramanian Seth Madison +Itay Kinnrot diff --git a/lib/player/i_video_source.js b/lib/player/i_video_source.js index af0d7e18c6..52caaf0297 100644 --- a/lib/player/i_video_source.js +++ b/lib/player/i_video_source.js @@ -158,12 +158,16 @@ shaka.player.IVideoSource.prototype.selectVideoTrack = * @param {number} id The |id| field of the desired AudioTrack object. * @param {boolean} clearBuffer If true, removes the previous stream's content * before switching to the new stream. + * @param {number=} opt_clearBufferOffset if |clearBuffer| and + * |opt_clearBufferOffset| are truthy, clear the stream buffer from the + * given offset (relative to the audio's current time) to the end of the + * stream. * * @return {boolean} True on success; otherwise, return false if the specified * AudioTrack does not exist or if an audio stream does not exist. */ shaka.player.IVideoSource.prototype.selectAudioTrack = - function(id, clearBuffer) {}; + function(id, clearBuffer, opt_clearBufferOffset) {}; /** diff --git a/lib/player/player.js b/lib/player/player.js index 9d3c4bed2d..4cfbc20713 100644 --- a/lib/player/player.js +++ b/lib/player/player.js @@ -564,14 +564,20 @@ shaka.player.Player.prototype.selectVideoTrack = function(id, opt_clearBuffer) { * @param {number} id The |id| field of the desired AudioTrack object. * @param {boolean=} opt_clearBuffer If true (and by default), removes the * previous stream's content before switching to the new stream. + * @param {number=} opt_clearBufferOffset if |clearBuffer| and + * |opt_clearBufferOffset| are truthy, clear the stream buffer from the + * given offset (relative to the audio's current time) to the end of the + * stream. * * @return {boolean} True if the specified AudioTrack was found. * @export */ -shaka.player.Player.prototype.selectAudioTrack = function(id, opt_clearBuffer) { +shaka.player.Player.prototype.selectAudioTrack = function(id, opt_clearBuffer, + opt_clearBufferOffset) { if (!this.videoSource_) return false; var clearBuffer = (opt_clearBuffer == undefined) ? true : opt_clearBuffer; - return this.videoSource_.selectAudioTrack(id, clearBuffer); + return this.videoSource_.selectAudioTrack(id, clearBuffer, + opt_clearBufferOffset); }; diff --git a/lib/player/stream_video_source.js b/lib/player/stream_video_source.js index 70db4c1abe..a72f8a1eb7 100644 --- a/lib/player/stream_video_source.js +++ b/lib/player/stream_video_source.js @@ -877,8 +877,8 @@ shaka.player.StreamVideoSource.prototype.selectVideoTrack = /** @override */ shaka.player.StreamVideoSource.prototype.selectAudioTrack = - function(id, clearBuffer) { - return this.selectTrack_('audio', id, clearBuffer); + function(id, clearBuffer, opt_clearBufferOffset) { + return this.selectTrack_('audio', id, clearBuffer, opt_clearBufferOffset); };