From 8b50b13a67c001b67e2e9d36b923c84cc1fb990f Mon Sep 17 00:00:00 2001 From: Mati en Qubit Date: Fri, 2 Jun 2017 18:18:53 -0300 Subject: [PATCH 1/3] audio and video stream ID in variant tracks --- externs/shaka/player.js | 8 +++++++- lib/util/stream_utils.js | 4 +++- test/offline/storage_unit.js | 4 +++- test/player_unit.js | 20 +++++++++++++++----- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/externs/shaka/player.js b/externs/shaka/player.js index 3173df6eb3..1953292d27 100644 --- a/externs/shaka/player.js +++ b/externs/shaka/player.js @@ -140,7 +140,9 @@ shakaExtern.Stats; * audioCodec: ?string, * videoCodec: ?string, * primary: boolean, - * roles: !Array. + * roles: !Array., + * videoId: ?number, + * audioId: ?number * }} * * @description @@ -190,6 +192,10 @@ shakaExtern.Stats; * cannot be satisfied. * @property {!Array.} roles * The roles of the track, e.g. 'main', 'caption', or 'commentary'. + * @property {?number} videoId + * (only for variant tracks) The video track id. + * @property {?number} audioId + * (only for variant tracks) The audio track id. * @exportDoc */ shakaExtern.Track; diff --git a/lib/util/stream_utils.js b/lib/util/stream_utils.js index cfc439aff7..650496c941 100644 --- a/lib/util/stream_utils.js +++ b/lib/util/stream_utils.js @@ -268,7 +268,9 @@ shaka.util.StreamUtils.getVariantTracks = audioCodec: audioCodec, videoCodec: videoCodec, primary: variant.primary, - roles: roles + roles: roles, + videoId: variant.video ? variant.video.id : null, + audioId: variant.audio ? variant.audio.id : null }; }); diff --git a/test/offline/storage_unit.js b/test/offline/storage_unit.js index 4c93f9f806..a3fb4e19e4 100644 --- a/test/offline/storage_unit.js +++ b/test/offline/storage_unit.js @@ -145,7 +145,9 @@ describe('Storage', function() { codecs: 'avc1.4d401f, vorbis', audioCodec: 'vorbis', videoCodec: 'avc1.4d401f', - roles: [] + roles: [], + videoId: 0, + audioId: 1 } ]; Promise diff --git a/test/player_unit.js b/test/player_unit.js index 76b7b2be40..f2660b5723 100644 --- a/test/player_unit.js +++ b/test/player_unit.js @@ -848,7 +848,9 @@ describe('Player', function() { audioCodec: 'mp4a.40.2', videoCodec: 'avc1.4d401f', primary: false, - roles: [] + roles: [], + videoId: 4, + audioId: 1 }, { id: 2, @@ -866,7 +868,9 @@ describe('Player', function() { audioCodec: 'mp4a.40.2', videoCodec: 'avc1.4d401f', primary: false, - roles: [] + roles: [], + videoId: 5, + audioId: 1 }, { id: 3, @@ -884,7 +888,9 @@ describe('Player', function() { audioCodec: 'mp4a.40.2', videoCodec: 'avc1.4d401f', primary: false, - roles: [] + roles: [], + videoId: 4, + audioId: 2 }, { id: 4, @@ -902,7 +908,9 @@ describe('Player', function() { audioCodec: 'mp4a.40.2', videoCodec: 'avc1.4d401f', primary: false, - roles: [] + roles: [], + videoId: 5, + audioId: 2 }, { id: 5, @@ -920,7 +928,9 @@ describe('Player', function() { audioCodec: 'mp4a.40.2', videoCodec: 'avc1.4d401f', primary: false, - roles: [] + roles: [], + videoId: 5, + audioId: 8 } ]; From 5728590c3f6155f07bc0053754c9c9fa8ac2a096 Mon Sep 17 00:00:00 2001 From: Mati en Qubit Date: Fri, 2 Jun 2017 18:26:35 -0300 Subject: [PATCH 2/3] contributors - video/audio stream IDs to variant tracks related to #823, #785 --- CONTRIBUTORS | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index aa15ac0c4c..49424f9316 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -40,6 +40,7 @@ Jonas Birmé Jono Ward Jozef Chúťka Lucas Gabriel Sánchez +Matias Russitto Mattias Wadman Natalie Harris Nick Desaulniers From 720bab45e7b5a41d93b846be5d702b051adf57eb Mon Sep 17 00:00:00 2001 From: Mati en argtop Date: Fri, 2 Jun 2017 21:54:41 -0300 Subject: [PATCH 3/3] its stream ID --- externs/shaka/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/externs/shaka/player.js b/externs/shaka/player.js index 1953292d27..4189e874b1 100644 --- a/externs/shaka/player.js +++ b/externs/shaka/player.js @@ -193,9 +193,9 @@ shakaExtern.Stats; * @property {!Array.} roles * The roles of the track, e.g. 'main', 'caption', or 'commentary'. * @property {?number} videoId - * (only for variant tracks) The video track id. + * (only for variant tracks) The video stream id. * @property {?number} audioId - * (only for variant tracks) The audio track id. + * (only for variant tracks) The audio stream id. * @exportDoc */ shakaExtern.Track;