+
+
{savedStreams.map((stream) => (
@@ -46,15 +63,47 @@ export function SavedOverlay({ onBack, onSelect, show }: SavedOverlayProps) {
))}
+
+
)
diff --git a/apps/www/components/stream-panel/use-stream-panel-sync.ts b/apps/www/components/stream-panel/use-stream-panel-sync.ts
index 9f70d9fd..d49ac601 100644
--- a/apps/www/components/stream-panel/use-stream-panel-sync.ts
+++ b/apps/www/components/stream-panel/use-stream-panel-sync.ts
@@ -2,46 +2,137 @@
import { useCallback, useEffect, useMemo, useRef } from "react"
-import type { StreamPreset } from "@/lib/stream-presets"
import type { Asset, UseAssetOptions } from "@/registry/default/hooks/use-asset"
+import type { PlaybackStore } from "@/registry/default/hooks/use-playback"
-import { useDocsDialStore } from "@/lib/docs-dial-store"
-import { getPresetById } from "@/lib/stream-presets"
+import {
+ addBlenderCaptions,
+ APPLE_MUSIC_CHARTS_PLAYLIST_ID,
+ type BlenderStreamResponse,
+ fetchBlenderStream,
+ fetchPlaylistPresetAssets,
+ isBlenderOpenFilmAsset,
+ type StreamPanelPlaylistPreset,
+} from "@/components/stream-panel/content-catalog"
+import {
+ type StreamPanelContentKind,
+ type StreamPanelPlayerType,
+ type StreamPanelSelection,
+ useStreamPanelStore,
+ useStreamPanelStoreHydrated,
+} from "@/components/stream-panel/use-stream-panel"
+import { getPresetsForType, type StreamPreset } from "@/lib/stream-presets"
import { useAsset } from "@/registry/default/hooks/use-asset"
+import { useMediaStore } from "@/registry/default/hooks/use-media"
+import { PLAYBACK_FEATURE_KEY } from "@/registry/default/hooks/use-playback"
+import { usePlayerStore } from "@/registry/default/hooks/use-player"
import { useVolumeStore } from "@/registry/default/hooks/use-volume"
-import { useMediaApi, useMediaStore } from "@/registry/default/internal/media"
+import { useMediaFeatureApi } from "@/registry/default/ui/media-provider"
-export function useStreamPanelSync() {
- const store = useMediaApi()
- const mediaElement = useMediaStore((state) => state.media.mediaElement)
- const player = useMediaStore((state) => state.player.instance)
+const DEFAULT_VIDEO_PRESET_ID = "mux-big-buck-bunny"
- const volume = useDocsDialStore((s) => s.volume)
- const muted = useDocsDialStore((s) => s.muted)
- const autoplay = useDocsDialStore((s) => s.autoplay)
- const presetId = useDocsDialStore((s) => s.presetId)
+export function useStreamPanelSync({
+ playerType = "video",
+}: {
+ playerType?: StreamPanelPlayerType
+} = {}) {
+ const playbackApi = useMediaFeatureApi
(PLAYBACK_FEATURE_KEY)
+ const mediaElement = useMediaStore((state) => state.mediaElement)
+ const player = usePlayerStore((state) => state.instance)
+
+ const volume = useStreamPanelStore((s) => s.volume)
+ const muted = useStreamPanelStore((s) => s.muted)
+ const autoplay = useStreamPanelStore((s) => s.autoplay)
+ const contentSelection = useStreamPanelStore(
+ (s) => s.contentSelections[playerType]
+ )
+ const storeHydrated = useStreamPanelStoreHydrated()
+ const setContentSelection = useStreamPanelStore((s) => s.setContentSelection)
const setVolume = useVolumeStore((s) => s.setVolume)
const setMuted = useVolumeStore((s) => s.setMuted)
+ const playlistAbortRef = useRef(null)
+ const restoredSelectionRef = useRef(false)
+ const blenderStreamCacheRef = useRef