Files
video.js-mirror/apps/sandbox/app/shared/html/chapters.ts

11 lines
329 B
TypeScript

import type { ChapterTrack } from '../sources';
export function renderChapters(tracks: readonly ChapterTrack[]): string {
return tracks
.map(
({ isDefault, label, lang, src }) =>
`<track kind="chapters" label="${label}" srclang="${lang}" src="${src}"${isDefault ? ' default' : ''} />`
)
.join('');
}