mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 03:22:15 +00:00
BREAKING CHANGES: The `duration` property in `StreamingInfo` has been replaced by the asynchronous `getDuration()` function, as getting the duration of Post Live DVR videos requires making a fetch request.
32 lines
790 B
TypeScript
32 lines
790 B
TypeScript
import { YTNode } from '../helpers.js';
|
|
import type { RawNode } from '../index.js';
|
|
|
|
export interface LiveStoryboardData {
|
|
type: 'live',
|
|
template_url: string,
|
|
thumbnail_width: number,
|
|
thumbnail_height: number,
|
|
columns: number,
|
|
rows: number
|
|
}
|
|
|
|
export default class PlayerLiveStoryboardSpec extends YTNode {
|
|
static type = 'PlayerLiveStoryboardSpec';
|
|
|
|
board: LiveStoryboardData;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
|
|
const [ template_url, thumbnail_width, thumbnail_height, columns, rows ] = data.spec.split('#');
|
|
|
|
this.board = {
|
|
type: 'live',
|
|
template_url,
|
|
thumbnail_width: parseInt(thumbnail_width, 10),
|
|
thumbnail_height: parseInt(thumbnail_height, 10),
|
|
columns: parseInt(columns, 10),
|
|
rows: parseInt(rows, 10)
|
|
};
|
|
}
|
|
} |