• Updates the current playback state

    Applies partial updates to the playback state, merging the provided changes with the existing state. This is the primary method for modifying the playback state and ensures that only the specified properties are updated while preserving other state values.

    Parameters

    • updates: Partial<PlaybackState>

      Partial state object containing only the properties to update

    Returns void

    // Update progress information
    updatePlaybackState({
    currentTrackProgress: 45000,
    currentTrackProgressPercent: 0.25,
    lastUpdated: Date.now()
    });
    // Update track information
    updatePlaybackState({
    currentTrackId: '1234567890',
    currentTrackName: 'Song Title',
    currentArtistName: 'Artist Name',
    currentAlbumName: 'Album Name',
    isPlaying: true
    });
    export function updatePlaybackState(updates: Partial<PlaybackState>): void {
    playbackState = {
    ...playbackState,
    ...updates,
    };
    }