*Audio Playback*

Content API:
 - Enabling CORS for access from Blazor app
Web Server:
 - Content API URL environment config
 - Web Audio API JS Interop layer in TypeScript
 - HttpClient configs
Web Client:
 - Audio Tack player controls
 - Audio Player example page
 - Audio Interop Service Layer
 - Named HttpClients
This commit is contained in:
daniel-c-harvey
2025-09-05 10:48:07 -04:00
parent a04bf06327
commit 7f78545a02
24 changed files with 1316 additions and 18 deletions
@@ -1,14 +1,29 @@
using Microsoft.AspNetCore.Components;
using DeepDrftModels.Entities;
using DeepDrftWeb.Client.Clients;
using MudBlazor;
namespace DeepDrftWeb.Client.Controls;
public partial class TrackPlayer : ComponentBase
{
[Parameter] public TrackEntity? Track { get; set; }
private void HandlePlayClick()
[Parameter] public required TrackEntity Track { get; set; }
[Inject] public required TrackMediaClient Client { get; set; }
private Stream? _audioStream = null;
private bool _isPlaying = false;
private string _playPauseIcon => _isPlaying ? Icons.Material.Filled.Pause : Icons.Material.Filled.PlayArrow;
private async Task HandlePlayClick()
{
// TODO: Implement play functionality with injected service
if (_audioStream == null)
{
_audioStream = await Client.GetTrackMedia(Track.EntryKey);
PlayAudio();
}
}
private void PlayAudio()
{
throw new NotImplementedException();
}
}