7f78545a02
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
18 lines
451 B
C#
18 lines
451 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace DeepDrftWeb.Client.Clients;
|
|
|
|
public class TrackMediaClient
|
|
{
|
|
private readonly HttpClient _http;
|
|
|
|
public TrackMediaClient(IHttpClientFactory httpClientFactory)
|
|
{
|
|
_http = httpClientFactory.CreateClient("DeepDrft.Content");
|
|
}
|
|
|
|
public async Task<Stream> GetTrackMedia(string trackId)
|
|
{
|
|
return await _http.GetStreamAsync($"api/track/{trackId}");
|
|
}
|
|
} |