From c7c5e94a32f402edc1ab8dd2b492139bb5079e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Thu, 23 Feb 2023 21:00:50 +0100 Subject: [PATCH] feat: Add getManifestType method (#5021) --- lib/cast/cast_utils.js | 1 + lib/player.js | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/cast/cast_utils.js b/lib/cast/cast_utils.js index 5910b58765..62b026a550 100644 --- a/lib/cast/cast_utils.js +++ b/lib/cast/cast_utils.js @@ -325,6 +325,7 @@ shaka.cast.CastUtils.PlayerGetterMethods = { 'keySystem': 10, 'seekRange': 1, 'getLoadMode': 10, + 'getManifestType': 10, }; diff --git a/lib/player.js b/lib/player.js index e26d67994d..e0c2dd77cb 100644 --- a/lib/player.js +++ b/lib/player.js @@ -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