MCPcopy Index your code
hub / github.com/nukeop/nuclear / derivePlayback

Function derivePlayback

packages/player/src/remoteControl/useRemoteState.ts:43–53  ·  view source on GitHub ↗
(playback: PlaybackState | null)

Source from the content-addressed store, hash-verified

41};
42
43const derivePlayback = (playback: PlaybackState | null) => {
44 const elapsed = playback?.seek ?? 0;
45 const duration = playback?.duration ?? 0;
46
47 return {
48 isPlaying: playback?.status === 'playing',
49 progress: duration > 0 ? (elapsed / duration) * 100 : 0,
50 elapsedSeconds: elapsed,
51 remainingSeconds: duration - elapsed,
52 };
53};
54
55type RemoteState = {
56 connectionStatus: ConnectionStatus;

Callers 1

useRemoteStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected