{#if !headless}
{#if $ffmpegBanner.phase !== 'idle' || $activeTrackDownloads.length > 0}
{#if $ffmpegBanner.phase !== 'idle'}

Downloading FFmpeg {#if formatMegabytes($ffmpegBanner.totalBytes)} ({formatMegabytes($ffmpegBanner.totalBytes)}) {/if}

{#if $ffmpegBanner.phase === 'countdown'}

Starting in {$ffmpegBanner.countdownSeconds} seconds…

{:else if $ffmpegBanner.phase === 'loading'}

Preparing encoder… {formatPercent($ffmpegBanner.progress)}

{:else if $ffmpegBanner.phase === 'ready'}

FFmpeg is ready to use.

{:else if $ffmpegBanner.phase === 'error'}

{$ffmpegBanner.error ?? 'Failed to load FFmpeg.'}

{/if}
{#if $ffmpegBanner.dismissible} {/if}
{#if $ffmpegBanner.phase === 'loading'}
{/if}
{/if} {#each $activeTrackDownloads as task (task.id)}

{#if task.progress < 0.02} {:else} {/if} {task.title}

{#if task.subtitle}

{task.subtitle}

{/if}
{formatTransferStatus(task.receivedBytes, task.totalBytes)} {formatPercent(task.progress)}
{/each}
{/if}
{#if $playerStore.currentTrack}
{formatTime($playerStore.currentTime)} {formatTime($playerStore.duration)}
{#if $playerStore.currentTrack}
{#if !isSonglinkTrack($playerStore.currentTrack)} {#if asTrack($playerStore.currentTrack).album.videoCover} {:else if asTrack($playerStore.currentTrack).album.cover} {$playerStore.currentTrack.title} {/if} {/if}

{$playerStore.currentTrack.title}{!isSonglinkTrack($playerStore.currentTrack) && asTrack($playerStore.currentTrack).version ? ` (${asTrack($playerStore.currentTrack).version})` : ''}

{#if isSonglinkTrack($playerStore.currentTrack)}

{$playerStore.currentTrack.artistName}

{:else} {formatArtists(asTrack($playerStore.currentTrack).artists)}

{asTrack($playerStore.currentTrack).album.title} {#if currentPlaybackQuality} {formatQualityLabel(currentPlaybackQuality)} {/if} {#if currentPlaybackQuality && asTrack($playerStore.currentTrack).audioQuality && currentPlaybackQuality !== asTrack($playerStore.currentTrack).audioQuality} ({formatQualityLabel(asTrack($playerStore.currentTrack).audioQuality)} available) {/if} {#if bitDepthLabel} {bitDepthLabel} {/if} {#if sampleRateLabel} {sampleRateLabel} {/if}

{/if}
{/if}
{#if showQueuePanel}
Playback Queue {$playerStore.queue.length}
{#if $playerStore.queue.length > 0}
    {#each $playerStore.queue as queuedTrack, index}
  • playFromQueue(index)} onkeydown={(event) => { if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); playFromQueue(index); } }} tabindex="0" role="button" class="group flex w-full cursor-pointer items-center gap-3 rounded-xl px-3 py-2 text-left transition-colors {index === $playerStore.queueIndex ? 'bg-blue-500/10 text-white' : 'text-gray-200 hover:bg-gray-800/70'}" > {index + 1}

    {queuedTrack.title}{!isSonglinkTrack(queuedTrack) && asTrack(queuedTrack).version ? ` (${asTrack(queuedTrack).version})` : ''}

    {#if isSonglinkTrack(queuedTrack)}

    {queuedTrack.artistName}

    {:else} e.stopPropagation()} class="truncate text-xs text-gray-400 hover:text-blue-400 hover:underline inline-block" data-sveltekit-preload-data > {formatArtists(asTrack(queuedTrack).artists)} {/if}
  • {/each}
{:else}

Queue is empty

{/if}
{/if} {#if $playerStore.currentTrack && $playerStore.isLoading}

Loading track…

{/if} {:else}
Nothing is playing
{/if}
{/if}