diff --git a/src/components/video-container/Video-container.component.ts b/src/components/video-container/Video-container.component.ts index 8a2ce08..63ce411 100644 --- a/src/components/video-container/Video-container.component.ts +++ b/src/components/video-container/Video-container.component.ts @@ -22,14 +22,14 @@ import { sourcesController, SourcesController } from "./sources"; const INIT_NATIVE_HLS_RE = /^((?!chrome|android).)*safari/i; // In Safari on live streams video.duration = Infinity -const getVideoDuration = (video: HTMLVideoElement) => { +const getVideoDuration = (video: HTMLVideoElement): number => { if (video.duration && video.duration !== Infinity) { return video.duration } if (video.seekable.length > 0) { return video.seekable.end(0) } - return 0 + return Infinity } /** diff --git a/src/components/video-timeline/Video-timeline.component.ts b/src/components/video-timeline/Video-timeline.component.ts index d403e91..144d121 100644 --- a/src/components/video-timeline/Video-timeline.component.ts +++ b/src/components/video-timeline/Video-timeline.component.ts @@ -71,6 +71,9 @@ export class VideoTimeline extends DependentPropsMixin(LitElement) { @state() currentTime = 0; + @connect('played') + played: boolean + @state() currentValue = 0; @@ -128,9 +131,9 @@ export class VideoTimeline extends DependentPropsMixin(LitElement) { }; render() { - const disabled = this.disabled || !this.canPlay; + const disabled = this.disabled || !this.canPlay || this.duration === Infinity; - if (!this.duration || this.duration === Infinity) return nothing + if (this.duration === Infinity && this.played) return nothing return html`