Skip to content

Commit

Permalink
feat: Add width/height to getFetchedPlaybackInfo (#7107)
Browse files Browse the repository at this point in the history
Issues #6725
  • Loading branch information
theodab authored Jul 29, 2024
1 parent ac9a6ca commit e58ac70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion externs/shaka/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,13 +628,17 @@ shaka.extern.PlaybackInfo;
* @typedef {{
* codecs: string,
* mimeType: string,
* bandwidth: number
* bandwidth: number,
* width: ?number,
* height: ?number
* }}
*
* @description Represents the state of the given stream.
* @property {string} codecs
* @property {string} mimeType
* @property {number} bandwidth
* @property {?number} width
* @property {?number} height
* @exportDoc
*/
shaka.extern.PlaybackStreamInfo;
Expand Down
2 changes: 2 additions & 0 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -6262,6 +6262,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
'bandwidth': reference.bandwidth || stream.bandwidth,
});
if (stream.type == ContentType.VIDEO) {
info['width'] = stream.width;
info['height'] = stream.height;
output['video'] = info;
} else if (stream.type == ContentType.AUDIO) {
output['audio'] = info;
Expand Down

0 comments on commit e58ac70

Please sign in to comment.