mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +00:00
feat(Parser): Add ThumbnailOverlayTitleView and PageIndicatorView classes (#1120)
Add two missing parser classes that were being JIT-generated at runtime: - ThumbnailOverlayTitleView: Displays title/subtitle overlays on thumbnails - PageIndicatorView: Tracks pagination state in carousels (indicator count and selected index) These are encountered when parsing Mix/Playlist responses.
This commit is contained in:
15
src/parser/classes/PageIndicatorView.ts
Normal file
15
src/parser/classes/PageIndicatorView.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
|
||||
export default class PageIndicatorView extends YTNode {
|
||||
static type = 'PageIndicatorView';
|
||||
|
||||
public indicator_count: number;
|
||||
public selected_index: number;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.indicator_count = data.indicatorCount ?? 0;
|
||||
this.selected_index = data.selectedIndex ?? 0;
|
||||
}
|
||||
}
|
||||
15
src/parser/classes/ThumbnailOverlayTitleView.ts
Normal file
15
src/parser/classes/ThumbnailOverlayTitleView.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
|
||||
export default class ThumbnailOverlayTitleView extends YTNode {
|
||||
static type = 'ThumbnailOverlayTitleView';
|
||||
|
||||
public title: string;
|
||||
public subtitle: string;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.title = data.title?.content ?? '';
|
||||
this.subtitle = data.subtitle?.content ?? '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user