feat: Spotify-style transfer between devices
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
- persistent remote playback bar when another session is playing (device, title, play/pause, Transfer here) - transfer remote -> local for audio and video, preserving position and queue, then stop the remote session - cast from local players now sends the queue, start index and position, and stops local playback after the transfer - full-screen player and remote dialog share the transfer payload
This commit is contained in:
1 parent
a98663691d
commit
fa29331c1c
12 files changed
+421
-21
No files matched your search
@@ -69,6 +69,7 @@ export const generateAudioStreamUrl = (
|
||||
deviceId: string,
|
||||
basePath: string,
|
||||
api_key: string,
|
||||
startTimeTicks = 0,
|
||||
) => {
|
||||
const transcodingProfile = playbackProfile.TranscodingProfiles?.filter(
|
||||
(val) => val.Type === "Audio" && val.Context === "Streaming",
|
||||
@@ -100,7 +101,7 @@ export const generateAudioStreamUrl = (
|
||||
transcodingProtocol: transcodingProfile?.Protocol,
|
||||
audioCodec: transcodingProfile?.AudioCodec,
|
||||
playSessionId: Date.now(),
|
||||
startTimeTicks: 0,
|
||||
startTimeTicks,
|
||||
enableRemoteMedia: false,
|
||||
enableAudioVbrEncoding: true,
|
||||
};
|
||||
|
||||
@@ -1,19 +1,36 @@
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { create } from "zustand";
|
||||
|
||||
export type RemoteTransfer = {
|
||||
/** Item to offer for "Play on..." / "Transfer here". */
|
||||
item?: BaseItemDto | null;
|
||||
/** Where the transfer starts from (used when moving local playback). */
|
||||
kind?: "audio" | "video" | "item";
|
||||
positionTicks?: number;
|
||||
queue?: BaseItemDto[];
|
||||
startIndex?: number;
|
||||
};
|
||||
|
||||
type RemoteControlState = {
|
||||
open: boolean;
|
||||
/** Item to offer for "Play on ..." when the dialog is opened from a player. */
|
||||
item: BaseItemDto | null;
|
||||
openDialog: (item?: BaseItemDto | null) => void;
|
||||
transfer: RemoteTransfer | null;
|
||||
openDialog: (arg?: BaseItemDto | RemoteTransfer | null) => void;
|
||||
closeDialog: () => void;
|
||||
};
|
||||
|
||||
const toTransfer = (
|
||||
arg?: BaseItemDto | RemoteTransfer | null,
|
||||
): RemoteTransfer | null => {
|
||||
if (!arg) return null;
|
||||
if ("Type" in arg) return { item: arg as BaseItemDto };
|
||||
return arg as RemoteTransfer;
|
||||
};
|
||||
|
||||
const useRemoteControlStore = create<RemoteControlState>((set) => ({
|
||||
open: false,
|
||||
item: null,
|
||||
openDialog: (item = null) => set({ open: true, item: item ?? null }),
|
||||
closeDialog: () => set({ open: false, item: null }),
|
||||
transfer: null,
|
||||
openDialog: (arg = null) => set({ open: true, transfer: toTransfer(arg) }),
|
||||
closeDialog: () => set({ open: false, transfer: null }),
|
||||
}));
|
||||
|
||||
export default useRemoteControlStore;
|
||||
Reference in new issue
Block a user