Skip to content

Commit

Permalink
Merge pull request #729 from CodeCrowCorp/dev
Browse files Browse the repository at this point in the history
Fix: removed released feature flags and added multistream flag
  • Loading branch information
gagansuie authored Sep 30, 2023
2 parents a3fe7f4 + 215aa18 commit 1eed570
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 96 deletions.
12 changes: 12 additions & 0 deletions src/lib/assets/icons/channel/IconMultistream.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-6 h-6">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M2.25 18L9 11.25l4.306 4.307a11.95 11.95 0 015.814-5.519l2.74-1.22m0 0l-5.94-2.28m5.94 2.28l-2.28 5.941" />
</svg>
16 changes: 12 additions & 4 deletions src/lib/assets/icons/channel/IconShareAudio.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z" />
</svg>

<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-6 h-6">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z" />
</svg>
9 changes: 0 additions & 9 deletions src/lib/assets/icons/channel/IconUser.svelte

This file was deleted.

26 changes: 22 additions & 4 deletions src/lib/components/Channel/Stream/StreamControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
import { channel_connection } from '$lib/stores/websocketStore'
import { onDestroy, onMount } from 'svelte'
import IconShareObs from '$lib/assets/icons/channel/IconShareObs.svelte'
import { is_feature_obs_enabled } from '$lib/stores/remoteConfigStore'
import { is_feature_multistream_enabled } from '$lib/stores/remoteConfigStore'
import IconMultistream from '$lib/assets/icons/channel/IconMultistream.svelte'
export let isHostOrGuest: boolean = false,
channel: any,
Expand Down Expand Up @@ -354,12 +355,29 @@
<IconShareAudio />
</button>

{#if $is_feature_obs_enabled}
<button
class="btn text-white border-none tooltip font-normal normal-case {$is_sharing_obs
? 'btn-primary'
: 'btn-neutral'}"
data-tip="OBS"
on:click={() => {
$is_sharing_obs = !$is_sharing_obs
}}
disabled={$is_sharing_screen ||
$is_sharing_webcam ||
$is_sharing_audio ||
!isHostOrGuest ||
!isChannelSocketConnected ||
!videoItemIsActive}>
<IconShareObs />
</button>

{#if $is_feature_multistream_enabled}
<button
class="btn text-white border-none tooltip font-normal normal-case {$is_sharing_obs
? 'btn-primary'
: 'btn-neutral'}"
data-tip="OBS"
data-tip="Multistream"
on:click={() => {
$is_sharing_obs = !$is_sharing_obs
}}
Expand All @@ -369,7 +387,7 @@
!isHostOrGuest ||
!isChannelSocketConnected ||
!videoItemIsActive}>
<IconShareObs />
<IconMultistream />
</button>
{/if}

Expand Down
57 changes: 27 additions & 30 deletions src/lib/components/Channel/Stream/VideoItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import { emitChannelUpdate } from '$lib/websocket'
import { captureScreenShot, dataURLtoFile, getColoredRole, setRole } from '$lib/utils'
import IconChatBan from '$lib/assets/icons/chat/IconChatBan.svelte'
import { is_feature_stats_enabled, is_feature_obs_enabled } from '$lib/stores/remoteConfigStore'
import { addScreen, getScreen, removeScreen } from '$lib/stream-utils'
import IconDrawerVerification from '$lib/assets/icons/drawer/IconDrawerVerification.svelte'
import { get, patch, putImage } from '$lib/api'
Expand Down Expand Up @@ -89,7 +88,7 @@
handleAudioChanges()
}
$: if ($is_feature_stats_enabled && (isScreenLive || iframeUrl)) {
$: if (isScreenLive || iframeUrl) {
toggleTimer(true)
} else {
toggleTimer(false)
Expand Down Expand Up @@ -499,15 +498,15 @@
? 'mask-hexagon'
: 'mask-squircle'} object-cover m-auto" />
<div class="absolute inset-0">
{#if $is_feature_stats_enabled && (isScreenLive || iframeUrl)}
{#if isScreenLive || iframeUrl}
<span
class="z-10 btn btn-sm btn-neutral font-medium text-white border-none items-center w-fit absolute top-2 left-2 {isHoverVideo
? 'opacity-100'
: 'opacity-50'}">
{formattedTime}
</span>
{/if}
{#if $is_feature_obs_enabled && iframeUrl}
{#if iframeUrl}
<div class="absolute rounded-md w-full h-full">
<iframe
bind:this={obs_element}
Expand Down Expand Up @@ -579,29 +578,27 @@
</div>
</div>

{#if $is_feature_obs_enabled}
<dialog bind:this={obs_modal} class="modal">
<form method="dialog" class="modal-box">
<h3 class="font-bold text-lg">Copy to OBS</h3>
<p class="py-4">
Server: <br />
{#if !video.obs?.rtmps?.url}
<span class="loading loading-dots loading-sm" />
{:else}
{video.obs?.rtmps?.url}
{/if}
</p>
<p class="py-4 break-all">
Stream Key: <br />
{#if !video.obs?.rtmps?.streamKey}
<span class="loading loading-dots loading-sm" />
{:else}
{video.obs?.rtmps?.streamKey}
{/if}
</p>
<div class="modal-action">
<button class="btn">Close</button>
</div>
</form>
</dialog>
{/if}
<dialog bind:this={obs_modal} class="modal">
<form method="dialog" class="modal-box">
<h3 class="font-bold text-lg">Copy to OBS</h3>
<p class="py-4">
Server: <br />
{#if !video.obs?.rtmps?.url}
<span class="loading loading-dots loading-sm" />
{:else}
{video.obs?.rtmps?.url}
{/if}
</p>
<p class="py-4 break-all">
Stream Key: <br />
{#if !video.obs?.rtmps?.streamKey}
<span class="loading loading-dots loading-sm" />
{:else}
{video.obs?.rtmps?.streamKey}
{/if}
</p>
<div class="modal-action">
<button class="btn">Close</button>
</div>
</form>
</dialog>
20 changes: 11 additions & 9 deletions src/lib/components/Profile/Elements/UserDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@
{/if}

<div class="pt-4 mb-2 flex flex-col">
<div class="card bg-base-200 p-3 tooltip tooltip-left" data-tip="social">
<div
class="flex gap-2 justify-center items-center lg:overflow-hidden overflow-auto max-w-full">
{#each profile.urls || [] as url, index (index)}
{#if url}
<Favicon {url} />
{/if}
{/each}
{#if profile.urls?.length}
<div class="card bg-base-200 p-3 tooltip tooltip-left" data-tip="social">
<div
class="flex gap-2 justify-center items-center lg:overflow-hidden overflow-auto max-w-full">
{#each profile.urls || [] as url, index (index)}
{#if url}
<Favicon {url} />
{/if}
{/each}
</div>
</div>
</div>
{/if}

{#if profile.category?.length}
<div class="card bg-base-200 p-3 mt-4 tooltip tooltip-left" data-tip="category">
Expand Down
31 changes: 13 additions & 18 deletions src/lib/components/Profile/TabSection.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import SectionTable from '$lib/components/Browse/Sections/SectionTable.svelte'
import Stats from '$lib/components/Profile/Elements/Stats.svelte'
import Events from '$lib/components/Profile/Events.svelte'
import { is_feature_stats_enabled } from '$lib/stores/remoteConfigStore'
import { onMount } from 'svelte'
import { env } from '$env/dynamic/public'
Expand All @@ -22,9 +21,7 @@
let activeTab = 0
onMount(() => {
$is_feature_stats_enabled = env.PUBLIC_FEATURE_STATS === 'true'
tabs = ['Channels', 'Followers', 'Events']
if ($is_feature_stats_enabled) tabs.push('Stats')
tabs = ['Channels', 'Followers', 'Events', 'Stats']
})
</script>

Expand All @@ -48,20 +45,18 @@
<div class="flex-auto h-full" class:hidden={activeTab != tabs.indexOf('Events')}>
<Events profileId={profile._id} />
</div>
{#if $is_feature_stats_enabled}
<div class="grid h-full" class:hidden={activeTab != tabs.indexOf('Stats')}>
<Stats
{profile}
{avgMins}
{viewsMonthlyIncr}
{streakMonthlyIncr}
{totalMinsMonthlyIncr}
{totalChannelViews}
{totalChannelViews4Weeks}
{highestAndCurrentStreak}
{totalMins} />
</div>
{/if}
<div class="grid h-full" class:hidden={activeTab != tabs.indexOf('Stats')}>
<Stats
{profile}
{avgMins}
{viewsMonthlyIncr}
{streakMonthlyIncr}
{totalMinsMonthlyIncr}
{totalChannelViews}
{totalChannelViews4Weeks}
{highestAndCurrentStreak}
{totalMins} />
</div>
</div>
</div>
</div>
29 changes: 16 additions & 13 deletions src/lib/components/Search/ItemSearchUser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
</div>
</div>
<div class="flex-auto flex flex-col gap-2">
<div class="flex flex-wrap">
{#if item.category && item.category.length}
{#if item.category?.length}
<div class="flex flex-wrap">
{#each item.category as category}
<div class="tooltip" data-tip={category}>
<img src={$category_list[category]} alt="" class="h-10 w-10 m-1" />
</div>
{/each}
{/if}
</div>
</div>
{/if}

<h2 class="text-xl font-semibold">
{item.displayName || ''}
</h2>
Expand All @@ -41,15 +42,17 @@
<h2 class="text-md">
{item.bio || ''}
</h2>
<div class="flex gap-2 items-center">
{#each item.urls || [] as url, index (index)}
{#if url}
<div class="tooltip" data-tip={url}>
<Favicon {url} />
</div>
{/if}
{/each}
</div>
{#if item.urls?.length}
<div class="flex gap-2 items-center">
{#each item.urls || [] as url, index (index)}
{#if url}
<div class="tooltip" data-tip={url}>
<Favicon {url} />
</div>
{/if}
{/each}
</div>
{/if}
</div>
</div>
</a>
4 changes: 1 addition & 3 deletions src/lib/stores/remoteConfigStore.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { writable, type Writable } from 'svelte/store'

export const is_feature_video_responses_enabled: Writable<boolean> = writable(false)
export const is_feature_stats_enabled: Writable<boolean> = writable(false)
export const is_feature_affiliate_enabled: Writable<boolean> = writable(false)
export const is_feature_apps_enabled: Writable<boolean> = writable(false)
export const is_feature_calendar_enabled: Writable<boolean> = writable(false)
export const is_feature_obs_enabled: Writable<boolean> = writable(false)
export const is_feature_multistream_enabled: Writable<boolean> = writable(false)
8 changes: 2 additions & 6 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
import { current_theme } from '$lib/stores/helperStore'
import {
is_feature_video_responses_enabled,
is_feature_stats_enabled,
is_feature_affiliate_enabled,
is_feature_apps_enabled,
is_feature_calendar_enabled,
is_feature_obs_enabled
is_feature_multistream_enabled
} from '$lib/stores/remoteConfigStore'
import { env } from '$env/dynamic/public'
import { user_role } from '$lib/stores/userStore'
Expand All @@ -50,11 +48,9 @@
onMount(async () => {
$current_theme = localStorage.getItem('theme') || 'dark'
$is_feature_video_responses_enabled = env.PUBLIC_FEATURE_VIDEO_RESPONSES === 'true'
$is_feature_stats_enabled = env.PUBLIC_FEATURE_STATS === 'true'
$is_feature_affiliate_enabled = env.PUBLIC_FEATURE_AFFILIATE === 'true'
$is_feature_apps_enabled = env.PUBLIC_FEATURE_APPS === 'true'
$is_feature_calendar_enabled = env.PUBLIC_FEATURE_CALENDAR === 'true'
$is_feature_obs_enabled = env.PUBLIC_FEATURE_OBS === 'true'
$is_feature_multistream_enabled = env.PUBLIC_FEATURE_MULTISTREAM === 'true'
await handleWebsocket()
if (!$category_list.length) {
$category_list = imageUrlsJson
Expand Down

0 comments on commit 1eed570

Please sign in to comment.