mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-28 09:06:51 +00:00
chore(AnimatedThumbnailOverlayView): Refactor thumbnail handling to use Thumbnail class
This commit is contained in:
@@ -1,25 +1,14 @@
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../types/index.js';
|
||||
import Thumbnail from './misc/Thumbnail.js';
|
||||
|
||||
export default class AnimatedThumbnailOverlayView extends YTNode {
|
||||
static type = 'AnimatedThumbnailOverlayView';
|
||||
|
||||
thumbnail: {
|
||||
sources: {
|
||||
url: string,
|
||||
width: number,
|
||||
height: number
|
||||
}[]
|
||||
};
|
||||
public thumbnail: Thumbnail[];
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.thumbnail = {
|
||||
sources: data.thumbnail.sources.map((item: any) => ({
|
||||
url: item.url,
|
||||
width: item.width,
|
||||
height: item.height
|
||||
}))
|
||||
};
|
||||
this.thumbnail = Thumbnail.fromResponse(data.thumbnail);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user