mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-24 15:21:54 +00:00
* refactor(video-info): rewrite heat-map extraction * fix(parser): Ensure heatmap mutations are processed only if mutations exist --------- Co-authored-by: Luan <luan.lrt4@gmail.com>
23 lines
885 B
TypeScript
23 lines
885 B
TypeScript
import { Parser, type RawNode } from '../index.js';
|
|
import HeatMarker from './HeatMarker.js';
|
|
import { type ObservedArray, YTNode } from '../helpers.js';
|
|
import TimedMarkerDecoration from './TimedMarkerDecoration.js';
|
|
|
|
export default class Heatmap extends YTNode {
|
|
static type = 'Heatmap';
|
|
|
|
max_height_dp: number;
|
|
min_height_dp: number;
|
|
show_hide_animation_duration_millis: number;
|
|
heat_markers: ObservedArray<HeatMarker>;
|
|
heat_markers_decorations: ObservedArray<YTNode>;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.max_height_dp = data.maxHeightDp;
|
|
this.min_height_dp = data.minHeightDp;
|
|
this.show_hide_animation_duration_millis = data.showHideAnimationDurationMillis;
|
|
this.heat_markers = Parser.parseArray(data.heatMarkers, HeatMarker);
|
|
this.heat_markers_decorations = Parser.parseArray(data.heatMarkersDecorations, TimedMarkerDecoration);
|
|
}
|
|
} |