2b42e01cd0
Queue owns ordered tracks, current index, skip-fwd/back, and auto-advance via the player's TrackEnded hook; binds through Attach (no ctor growth, no service-locator). Player-bar skip controls; empty-queue play unchanged. Adds QueueService unit tests.
29 lines
1.2 KiB
C#
29 lines
1.2 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace DeepDrftPublic.Client.Controls.AudioPlayerBar;
|
|
|
|
public partial class PlayerControls : ComponentBase
|
|
{
|
|
[Parameter] public required bool IsLoaded { get; set; }
|
|
|
|
/// <summary>
|
|
/// Whether the play button is enabled. Distinct from <see cref="IsLoaded"/> so a staged-but-
|
|
/// unloaded track (embed pre-gesture state) can still be played: the click loads it. Stop stays
|
|
/// gated on <see cref="IsLoaded"/>.
|
|
/// </summary>
|
|
[Parameter] public bool CanPlay { get; set; }
|
|
|
|
[Parameter] public bool Fixed { get; set; } = false;
|
|
[Parameter] public required EventCallback TogglePlayPause { get; set; }
|
|
[Parameter] public required EventCallback Stop { get; set; }
|
|
|
|
/// <summary>Whether the queue has a track to skip forward to. Drives the skip-next affordance.</summary>
|
|
[Parameter] public bool HasNext { get; set; }
|
|
|
|
/// <summary>Whether the queue has a track to step back to. Drives the skip-previous affordance.</summary>
|
|
[Parameter] public bool HasPrevious { get; set; }
|
|
|
|
[Parameter] public EventCallback SkipNext { get; set; }
|
|
[Parameter] public EventCallback SkipPrevious { get; set; }
|
|
}
|