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
23 lines
700 B
C#
23 lines
700 B
C#
using Microsoft.AspNetCore.Components;
|
|
using DeepDrftModels.Entities;
|
|
using DeepDrftWeb.Client.Clients;
|
|
using MudBlazor;
|
|
|
|
namespace DeepDrftWeb.Client.Controls;
|
|
|
|
public partial class TrackCard : ComponentBase
|
|
{
|
|
[Parameter] public required TrackEntity TrackModel { get; set; }
|
|
[Parameter] public EventCallback<TrackEntity> OnPlay { get; set; }
|
|
[Parameter] public bool IsPlaying { get; set; } = false;
|
|
|
|
private string PlayPauseIcon => IsPlaying ? Icons.Material.Filled.MusicNote : Icons.Material.Filled.PlayArrow;
|
|
|
|
private async Task PlayClick()
|
|
{
|
|
if (!IsPlaying && OnPlay.HasDelegate)
|
|
{
|
|
await OnPlay.InvokeAsync(TrackModel);
|
|
}
|
|
}
|
|
} |