Skip to content

Commit

Permalink
feat(parser): Add PlayerOverflow and PlayerControlsOverlay
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRT committed Oct 28, 2023
1 parent bc97e07 commit a45273f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/parser/classes/PlayerControlsOverlay.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { YTNode } from '../helpers.js';
import { Parser, type RawNode } from '../index.js';
import PlayerOverflow from './PlayerOverflow.js';

export default class PlayerControlsOverlay extends YTNode {
static type = 'PlayerControlsOverlay';

overflow: PlayerOverflow | null;

constructor(data: RawNode) {
super();
this.overflow = Parser.parseItem(data.overflow, PlayerOverflow);
}
}
16 changes: 16 additions & 0 deletions src/parser/classes/PlayerOverflow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { YTNode } from '../helpers.js';
import type { RawNode } from '../index.js';
import NavigationEndpoint from './NavigationEndpoint.js';

export default class PlayerOverflow extends YTNode {
static type = 'PlayerOverflow';

endpoint: NavigationEndpoint;
enable_listen_first: boolean;

constructor(data: RawNode) {
super();
this.endpoint = new NavigationEndpoint(data.endpoint);
this.enable_listen_first = data.enableListenFirst;
}
}
2 changes: 2 additions & 0 deletions src/parser/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,13 @@ export { default as PageHeaderView } from './classes/PageHeaderView.js';
export { default as PageIntroduction } from './classes/PageIntroduction.js';
export { default as PlayerAnnotationsExpanded } from './classes/PlayerAnnotationsExpanded.js';
export { default as PlayerCaptionsTracklist } from './classes/PlayerCaptionsTracklist.js';
export { default as PlayerControlsOverlay } from './classes/PlayerControlsOverlay.js';
export { default as PlayerErrorMessage } from './classes/PlayerErrorMessage.js';
export { default as PlayerLegacyDesktopYpcOffer } from './classes/PlayerLegacyDesktopYpcOffer.js';
export { default as PlayerLegacyDesktopYpcTrailer } from './classes/PlayerLegacyDesktopYpcTrailer.js';
export { default as PlayerLiveStoryboardSpec } from './classes/PlayerLiveStoryboardSpec.js';
export { default as PlayerMicroformat } from './classes/PlayerMicroformat.js';
export { default as PlayerOverflow } from './classes/PlayerOverflow.js';
export { default as PlayerOverlay } from './classes/PlayerOverlay.js';
export { default as PlayerOverlayAutoplay } from './classes/PlayerOverlayAutoplay.js';
export { default as PlayerStoryboardSpec } from './classes/PlayerStoryboardSpec.js';
Expand Down

0 comments on commit a45273f

Please sign in to comment.