From a9cdbf7010e7b9b9cfde5db645d51bdad51006c5 Mon Sep 17 00:00:00 2001 From: LuanRT Date: Sun, 16 Jul 2023 17:34:42 -0300 Subject: [PATCH] feat(parser): Add `ShowMiniplayerCommand` (#443) --- src/parser/parser.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/parser/parser.ts b/src/parser/parser.ts index 5801bdbfb..e4f66cc0f 100644 --- a/src/parser/parser.ts +++ b/src/parser/parser.ts @@ -413,6 +413,8 @@ export default class Parser { return observe(actions.map((action: any) => { if (action.navigateAction) return new NavigateAction(action.navigateAction); + if (action.showMiniplayerCommand) + return new ShowMiniplayerCommand(action.showMiniplayerCommand); if (action.reloadContinuationItemsCommand) return new ReloadContinuationItemsCommand(action.reloadContinuationItemsCommand); if (action.appendContinuationItemsAction) @@ -574,6 +576,19 @@ export class NavigateAction extends YTNode { } } +export class ShowMiniplayerCommand extends YTNode { + static readonly type = 'showMiniplayerCommand'; + + miniplayer_command: NavigationEndpoint; + show_premium_branding: boolean; + + constructor(data: RawNode) { + super(); + this.miniplayer_command = new NavigationEndpoint(data.miniplayerCommand); + this.show_premium_branding = data.showPremiumBranding; + } +} + export class AppendContinuationItemsAction extends YTNode { static readonly type = 'appendContinuationItemsAction';