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 6689bd7e2c..d32eda9a40 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 bec6629e89..d0cf5eb3bf 100644 --- a/test/player_unit.js +++ b/test/player_unit.js @@ -803,7 +803,9 @@ describe('Player', function() { audioCodec: 'mp4a.40.2', videoCodec: 'avc1.4d401f', primary: false, - roles: [] + roles: [], + videoId: 4, + audioId: 1 }, { id: 2, @@ -821,7 +823,9 @@ describe('Player', function() { audioCodec: 'mp4a.40.2', videoCodec: 'avc1.4d401f', primary: false, - roles: [] + roles: [], + videoId: 5, + audioId: 1 }, { id: 3, @@ -839,7 +843,9 @@ describe('Player', function() { audioCodec: 'mp4a.40.2', videoCodec: 'avc1.4d401f', primary: false, - roles: [] + roles: [], + videoId: 4, + audioId: 2 }, { id: 4, @@ -857,7 +863,9 @@ describe('Player', function() { audioCodec: 'mp4a.40.2', videoCodec: 'avc1.4d401f', primary: false, - roles: [] + roles: [], + videoId: 5, + audioId: 2 }, { id: 5, @@ -875,7 +883,9 @@ describe('Player', function() { audioCodec: 'mp4a.40.2', videoCodec: 'avc1.4d401f', primary: false, - roles: [] + roles: [], + videoId: 5, + audioId: 8 } ];