Add Cast button to NowPlayingBar and FullScreenNowPlaying
- Add Cast icon from lucide-svelte - Add onCast callback prop to both components - Show "Casting coming soon" toast when clicked - Backend cast module is disabled pending fixes
This commit is contained in:
1 parent
334f05b870
commit
8f26ce7df7
3 files changed
+18
-4
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { X, Shuffle, SkipBack, Play, Pause, SkipForward, Repeat, Heart, List, Mic2, Maximize2, MoreHorizontal } from 'lucide-svelte';
|
||||
import { X, Shuffle, SkipBack, Play, Pause, SkipForward, Repeat, Heart, List, Mic2, Maximize2, MoreHorizontal, Cast } from 'lucide-svelte';
|
||||
import QualityBadge from './QualityBadge.svelte';
|
||||
|
||||
interface Props {
|
||||
@@ -30,6 +30,7 @@
|
||||
onToggleFavorite: () => void;
|
||||
onOpenQueue?: () => void;
|
||||
onOpenFocusMode?: () => void;
|
||||
onCast?: () => void;
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -59,7 +60,8 @@
|
||||
isFavorite,
|
||||
onToggleFavorite,
|
||||
onOpenQueue,
|
||||
onOpenFocusMode
|
||||
onOpenFocusMode,
|
||||
onCast
|
||||
}: Props = $props();
|
||||
|
||||
let progressRef: HTMLDivElement;
|
||||
@@ -220,6 +222,9 @@
|
||||
<button class="action-btn" onclick={onOpenFocusMode}>
|
||||
<Maximize2 size={24} />
|
||||
</button>
|
||||
<button class="action-btn" onclick={onCast} title="Cast to device">
|
||||
<Cast size={24} />
|
||||
</button>
|
||||
<button class="action-btn">
|
||||
<Mic2 size={24} />
|
||||
</button>
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
List,
|
||||
Volume2,
|
||||
VolumeX,
|
||||
Volume1
|
||||
Volume1,
|
||||
Cast
|
||||
} from 'lucide-svelte';
|
||||
import QualityBadge from './QualityBadge.svelte';
|
||||
|
||||
@@ -40,6 +41,7 @@
|
||||
onToggleFavorite?: () => void;
|
||||
onOpenQueue?: () => void;
|
||||
onOpenFullScreen?: () => void;
|
||||
onCast?: () => void;
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -66,7 +68,8 @@
|
||||
isFavorite = false,
|
||||
onToggleFavorite,
|
||||
onOpenQueue,
|
||||
onOpenFullScreen
|
||||
onOpenFullScreen,
|
||||
onCast
|
||||
}: Props = $props();
|
||||
|
||||
let progressRef: HTMLDivElement;
|
||||
@@ -236,6 +239,9 @@
|
||||
<button class="action-btn" onclick={onOpenQueue}>
|
||||
<List size={20} />
|
||||
</button>
|
||||
<button class="action-btn" onclick={onCast} title="Cast to device">
|
||||
<Cast size={20} />
|
||||
</button>
|
||||
|
||||
<!-- Volume Control -->
|
||||
<div class="volume-control">
|
||||
|
||||
@@ -1529,11 +1529,13 @@
|
||||
onToggleFavorite={toggleFavorite}
|
||||
onOpenQueue={() => (isQueueOpen = true)}
|
||||
onOpenFullScreen={() => (isFullScreenOpen = true)}
|
||||
onCast={() => showToast('Casting coming soon', 'info')}
|
||||
/>
|
||||
{:else}
|
||||
<NowPlayingBar
|
||||
onOpenQueue={() => (isQueueOpen = true)}
|
||||
onOpenFullScreen={() => (isFullScreenOpen = true)}
|
||||
onCast={() => showToast('Casting coming soon', 'info')}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
@@ -1584,6 +1586,7 @@
|
||||
isFullScreenOpen = false;
|
||||
isFocusModeOpen = true;
|
||||
}}
|
||||
onCast={() => showToast('Casting coming soon', 'info')}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
|
||||
Reference in new issue
Block a user