Skip to content

Commit

Permalink
feat: Add getManifestType method (shaka-project#5021)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Feb 23, 2023
1 parent 472bcbb commit c7c5e94
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/cast/cast_utils.js
Expand Up @@ -325,6 +325,7 @@ shaka.cast.CastUtils.PlayerGetterMethods = {
'keySystem': 10,
'seekRange': 1,
'getLoadMode': 10,
'getManifestType': 10,
};


Expand Down
13 changes: 13 additions & 0 deletions lib/player.js
Expand Up @@ -3394,6 +3394,19 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
return this.loadMode_;
}

/**
* Get the current manifest type.
*
* @return {?string}
* @export
*/
getManifestType() {
if (!this.manifest_) {
return null;
}
return this.manifest_.type;
}

/**
* Get the media element that the player is currently using to play loaded
* content. If the player has not loaded content, this will return
Expand Down

0 comments on commit c7c5e94

Please sign in to comment.