Add whole-release embeds to FramePlayer and un-gate the release embed share affordance
The queue gains an armed-but-idle state (Arm/Start) so a release embed stages track 0 prerender-safe, then queues the full release on first play and auto-advances.
This commit is contained in:
@@ -26,6 +26,8 @@ public sealed class QueueService : IQueueService, IDisposable
|
||||
|
||||
public int CurrentIndex { get; private set; } = -1;
|
||||
|
||||
public bool IsArmed { get; private set; }
|
||||
|
||||
public TrackDto? Current =>
|
||||
CurrentIndex >= 0 && CurrentIndex < _items.Count ? _items[CurrentIndex] : null;
|
||||
|
||||
@@ -62,11 +64,34 @@ public sealed class QueueService : IQueueService, IDisposable
|
||||
_items.Clear();
|
||||
_items.AddRange(list);
|
||||
CurrentIndex = start;
|
||||
// Playback is now starting for real, so the queue is no longer merely armed.
|
||||
IsArmed = false;
|
||||
QueueChanged?.Invoke();
|
||||
|
||||
await PlayCurrent();
|
||||
}
|
||||
|
||||
public void Arm(IEnumerable<TrackDto> tracks)
|
||||
{
|
||||
var list = tracks as IReadOnlyList<TrackDto> ?? tracks.ToList();
|
||||
if (list.Count == 0) return;
|
||||
|
||||
_items.Clear();
|
||||
_items.AddRange(list);
|
||||
CurrentIndex = 0;
|
||||
IsArmed = true;
|
||||
// No PlayCurrent: arming is interop-free state only. The first play gesture drives Start().
|
||||
QueueChanged?.Invoke();
|
||||
}
|
||||
|
||||
public async Task Start()
|
||||
{
|
||||
if (!IsArmed) return;
|
||||
IsArmed = false;
|
||||
QueueChanged?.Invoke();
|
||||
await PlayCurrent();
|
||||
}
|
||||
|
||||
public void Enqueue(TrackDto track)
|
||||
{
|
||||
_items.Add(track);
|
||||
@@ -85,6 +110,7 @@ public sealed class QueueService : IQueueService, IDisposable
|
||||
{
|
||||
if (!HasNext) return;
|
||||
CurrentIndex++;
|
||||
IsArmed = false;
|
||||
QueueChanged?.Invoke();
|
||||
await PlayCurrent();
|
||||
}
|
||||
@@ -93,6 +119,7 @@ public sealed class QueueService : IQueueService, IDisposable
|
||||
{
|
||||
if (!HasPrevious) return;
|
||||
CurrentIndex--;
|
||||
IsArmed = false;
|
||||
QueueChanged?.Invoke();
|
||||
await PlayCurrent();
|
||||
}
|
||||
@@ -102,6 +129,7 @@ public sealed class QueueService : IQueueService, IDisposable
|
||||
if (_items.Count == 0 && CurrentIndex == -1) return;
|
||||
_items.Clear();
|
||||
CurrentIndex = -1;
|
||||
IsArmed = false;
|
||||
QueueChanged?.Invoke();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user