Implement Chromecast frontend and DLNA AVTransport casting
Frontend: - Add castStore for managing cast state (connect, disconnect, play, pause, etc) - Update CastPicker to use castStore, show connected device banner with disconnect - Wire isCastConnected to NowPlayingBar and ExpandedPlayer for visual indicator - Modify playbackService to cast when connected instead of local playback DLNA Backend: - Implement full AVTransport SOAP client with: - SetAVTransportURI with DIDL-Lite metadata - Play, Pause, Stop, Seek actions - RenderingControl SetVolume - Add dlna_play_track command that fetches stream, downloads audio, and serves via media server - Share media server between Chromecast and DLNA
This commit is contained in:
1 parent
a4c09041a4
commit
1ac6d15551
8 files changed
+1025
-143
No files matched your search
@@ -18,6 +18,13 @@ import {
|
||||
} from '$lib/stores/playerStore';
|
||||
import { syncQueueState } from '$lib/stores/queueStore';
|
||||
import { logRecoEvent } from '$lib/services/recoService';
|
||||
import {
|
||||
isCasting,
|
||||
castTrack,
|
||||
castPlay,
|
||||
castPause,
|
||||
castStop
|
||||
} from '$lib/stores/castStore';
|
||||
|
||||
// ============ Types ============
|
||||
|
||||
@@ -66,11 +73,23 @@ export async function playTrack(
|
||||
showToast(track.title, 'buffering');
|
||||
}
|
||||
|
||||
// Use appropriate playback command
|
||||
if (isLocal) {
|
||||
await invoke('library_play_track', { trackId: track.id });
|
||||
// Check if we're casting to an external device
|
||||
if (isCasting() && !isLocal) {
|
||||
// Cast to connected device
|
||||
await castTrack(track.id, {
|
||||
title: track.title,
|
||||
artist: track.artist,
|
||||
album: track.album,
|
||||
artworkUrl: track.artwork,
|
||||
durationSecs: track.duration
|
||||
});
|
||||
} else {
|
||||
await invoke('play_track', { trackId: track.id });
|
||||
// Use appropriate local playback command
|
||||
if (isLocal) {
|
||||
await invoke('library_play_track', { trackId: track.id });
|
||||
} else {
|
||||
await invoke('play_track', { trackId: track.id });
|
||||
}
|
||||
}
|
||||
|
||||
// Dismiss buffering toast and show success
|
||||
|
||||
Reference in new issue
Block a user