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 diff --git a/externs/shaka/player.js b/externs/shaka/player.js index 3173df6eb3..4189e874b1 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 stream id. + * @property {?number} audioId + * (only for variant tracks) The audio stream 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 } ];