|
|
@ -1,11 +1,12 @@ |
|
|
|
import { IconPatch } from "components/buttons/IconPatch"; |
|
|
|
import { IconPatch } from "components/buttons/IconPatch"; |
|
|
|
import { Icons } from "components/Icon"; |
|
|
|
import { Icons } from "components/Icon"; |
|
|
|
import { Loading } from "components/layout/Loading"; |
|
|
|
import { Loading } from "components/layout/Loading"; |
|
|
|
import { MWMediaStream } from "providers"; |
|
|
|
import { MWMediaCaption, MWMediaStream } from "providers"; |
|
|
|
import { ReactElement, useEffect, useRef, useState } from "react"; |
|
|
|
import { ReactElement, useEffect, useRef, useState } from "react"; |
|
|
|
|
|
|
|
|
|
|
|
export interface VideoPlayerProps { |
|
|
|
export interface VideoPlayerProps { |
|
|
|
source: MWMediaStream; |
|
|
|
source: MWMediaStream; |
|
|
|
|
|
|
|
captions: MWMediaCaption[]; |
|
|
|
startAt?: number; |
|
|
|
startAt?: number; |
|
|
|
onProgress?: (event: ProgressEvent) => void; |
|
|
|
onProgress?: (event: ProgressEvent) => void; |
|
|
|
} |
|
|
|
} |
|
|
@ -74,6 +75,9 @@ export function VideoPlayer(props: VideoPlayerProps) { |
|
|
|
{!mustUseHls ? ( |
|
|
|
{!mustUseHls ? ( |
|
|
|
<source src={props.source.url} type="video/mp4" /> |
|
|
|
<source src={props.source.url} type="video/mp4" /> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
|
|
|
|
{props.captions.map((v) => ( |
|
|
|
|
|
|
|
<track key={v.id} kind="captions" label={v.label} src={v.url} /> |
|
|
|
|
|
|
|
))} |
|
|
|
</video> |
|
|
|
</video> |
|
|
|
</> |
|
|
|
</> |
|
|
|
); |
|
|
|
); |
|
|
|