diff --git a/src/lib/components/Channel/Stream/StreamContainer.svelte b/src/lib/components/Channel/Stream/StreamContainer.svelte index b9df93d4..1635789c 100644 --- a/src/lib/components/Channel/Stream/StreamContainer.svelte +++ b/src/lib/components/Channel/Stream/StreamContainer.svelte @@ -24,6 +24,7 @@ import { is_feature_premium_enabled } from '$lib/stores/remoteConfigStore' import DropdownSponsors from '$lib/components/Channel/Stream/DropdownSponsors.svelte' import IconChatSponsor from '$lib/assets/icons/chat/IconChatSponsor.svelte' + import VodList from './VodList.svelte' const dispatch = createEventDispatcher() export let userCount: number = 1, @@ -160,6 +161,7 @@ {#if channel && nextchannel?._id === parseInt($page.params.channelId)} {/if} + {/each} diff --git a/src/lib/components/Channel/Stream/StreamControls.svelte b/src/lib/components/Channel/Stream/StreamControls.svelte index 80a90bfa..591c019c 100644 --- a/src/lib/components/Channel/Stream/StreamControls.svelte +++ b/src/lib/components/Channel/Stream/StreamControls.svelte @@ -82,7 +82,7 @@ trackType, liveInput: { meta: { - name: `${$page.params.channelId}-${$page.data.user?.userId}-webrtc-${trackType}` + name: $page.params.channelId }, recording: { mode: 'off' } } @@ -124,7 +124,7 @@ trackType: 'rtmps', liveInput: { meta: { - name: `${$page.params.channelId}-${$page.data.user?.userId}-rtmps` + name: $page.params.channelId }, recording: { mode: 'automatic' } } diff --git a/src/lib/components/Channel/Stream/VodList.svelte b/src/lib/components/Channel/Stream/VodList.svelte new file mode 100644 index 00000000..a55f36ea --- /dev/null +++ b/src/lib/components/Channel/Stream/VodList.svelte @@ -0,0 +1,30 @@ + + +{#if vods.length} +
+ {#each vods as vod} + + + +
+ {getTimeFormat(vod.duration)} +
+
+ {/each} +
+{:else} +

No VODs available

+{/if} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index a2a9b629..e9ef2025 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -429,3 +429,13 @@ export const updateVideoItems = (videoItems: any, liveInputs: any[]) => { } return vidItems } + +export const getTimeFormat = (duration: number) => { + const hours = Math.floor(duration / 3600) + const minutes = Math.floor((duration % 3600) / 60) + const seconds = Math.floor(duration % 60) + + const secondsFormat = seconds < 10 ? `0${seconds}` : seconds + + return hours > 0 ? `${hours}:${minutes}:${secondsFormat}` : `${minutes}:${secondsFormat}` +}