66d800bd26
- Redesign component wiring for audio playback - Removed playback logic from the player control and moved it to injectable audio player engine service - Chunked/buffered stream loading from Content API passed to Web Audio API playback in 8K blocks
24 lines
730 B
C#
24 lines
730 B
C#
using Microsoft.AspNetCore.Components;
|
|
using DeepDrftModels.Entities;
|
|
using DeepDrftWeb.Client.Clients;
|
|
|
|
namespace DeepDrftWeb.Client.Controls;
|
|
|
|
public partial class TracksGallery : ComponentBase
|
|
{
|
|
[Parameter] public IEnumerable<TrackEntity> Tracks { get; set; } = [];
|
|
[Parameter] public TrackEntity? SelectedTrack { get; set; }
|
|
[Parameter] public EventCallback<TrackEntity?> SelectedTrackChanged { get; set; }
|
|
|
|
private async Task HandlePlayClick(TrackEntity track)
|
|
{
|
|
if (SelectedTrack == track) return;
|
|
SelectedTrack = track;
|
|
StateHasChanged();
|
|
|
|
if (SelectedTrackChanged.HasDelegate)
|
|
{
|
|
await SelectedTrackChanged.InvokeAsync(track);
|
|
}
|
|
}
|
|
} |