Files
YouTube.js/src/parser/classes/PlayerOverlayAutoplay.ts
LuanRT 4181969d52 feat: properly type renderer parsers
CardCollection, ChipCloud, Endscreen, PlayerOverlay, PlayerOverlayAutoplay, VideoSecondaryInfo and WatchNextEndScreen.
2022-09-05 03:25:36 -03:00

43 lines
1.4 KiB
TypeScript

import Parser from '../index';
import Text from './misc/Text';
import Author from './misc/Author';
import Thumbnail from './misc/Thumbnail';
import Button from './Button';
import { YTNode } from '../helpers';
class PlayerOverlayAutoplay extends YTNode {
static type = 'PlayerOverlayAutoplay';
title: Text;
video_id: string;
video_title: Text;
short_view_count: Text;
prefer_immediate_redirect: any;
count_down_secs_for_fullscreen: any;
published: Text;
background: Thumbnail[];
thumbnail_overlays;
author: Author;
cancel_button;
next_button;
close_button;
constructor(data: any) {
super();
this.title = new Text(data.title);
this.video_id = data.videoId;
this.video_title = new Text(data.videoTitle);
this.short_view_count = new Text(data.shortViewCountText);
this.prefer_immediate_redirect = data.preferImmediateRedirect;
this.count_down_secs_for_fullscreen = data.countDownSecsForFullscreen;
this.published = new Text(data.publishedTimeText);
this.background = Thumbnail.fromResponse(data.background);
this.thumbnail_overlays = Parser.parse(data.thumbnailOverlays);
this.author = new Author(data.byline);
this.cancel_button = Parser.parseItem<Button>(data.cancelButton, Button);
this.next_button = Parser.parseItem<Button>(data.nextButton, Button);
this.close_button = Parser.parseItem<Button>(data.closeButton, Button);
}
}
export default PlayerOverlayAutoplay;