Skip to content

Commit

Permalink
feat(parser): Add PlayerOverlayVideoDetails node
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRT committed Nov 15, 2024
1 parent ad448f8 commit dc2ed04
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/parser/classes/PlayerOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ import { Parser, type RawNode } from '../index.js';
import Button from './Button.js';
import DecoratedPlayerBar from './DecoratedPlayerBar.js';
import PlayerOverlayAutoplay from './PlayerOverlayAutoplay.js';
import PlayerOverlayVideoDetails from './PlayerOverlayVideoDetails.js';
import WatchNextEndScreen from './WatchNextEndScreen.js';
import Menu from './menus/Menu.js';

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

end_screen: WatchNextEndScreen | null;
autoplay: PlayerOverlayAutoplay | null;
share_button: Button | null;
add_to_menu: Menu | null;
fullscreen_engagement: YTNode | null;
actions: ObservedArray<YTNode>;
browser_media_session: YTNode | null;
decorated_player_bar: DecoratedPlayerBar | null;
public end_screen: WatchNextEndScreen | null;
public autoplay: PlayerOverlayAutoplay | null;
public share_button: Button | null;
public add_to_menu: Menu | null;
public fullscreen_engagement: YTNode | null;
public actions: ObservedArray<YTNode>;
public browser_media_session: YTNode | null;
public decorated_player_bar: DecoratedPlayerBar | null;
public video_details: PlayerOverlayVideoDetails | null;

constructor(data: RawNode) {
super();
Expand All @@ -28,5 +30,6 @@ export default class PlayerOverlay extends YTNode {
this.actions = Parser.parseArray(data.actions);
this.browser_media_session = Parser.parseItem(data.browserMediaSession);
this.decorated_player_bar = Parser.parseItem(data.decoratedPlayerBarRenderer, DecoratedPlayerBar);
this.video_details = Parser.parseItem(data.videoDetails, PlayerOverlayVideoDetails);
}
}
16 changes: 16 additions & 0 deletions src/parser/classes/PlayerOverlayVideoDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Text } from '../misc.js';
import { YTNode } from '../helpers.js';
import { type RawNode } from '../index.js';

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

public title: Text;
public subtitle: Text;

constructor(data: RawNode) {
super();
this.title = new Text(data.title);
this.subtitle = new Text(data.subtitle);
}
}
1 change: 1 addition & 0 deletions src/parser/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ 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 PlayerOverlayVideoDetails } from './classes/PlayerOverlayVideoDetails.js';
export { default as PlayerStoryboardSpec } from './classes/PlayerStoryboardSpec.js';
export { default as Playlist } from './classes/Playlist.js';
export { default as PlaylistCustomThumbnail } from './classes/PlaylistCustomThumbnail.js';
Expand Down

0 comments on commit dc2ed04

Please sign in to comment.