Новый плеер

This commit is contained in:
FrigaT
2026-04-16 15:37:02 +03:00
parent a634986ac0
commit 974fb0f538
5 changed files with 62 additions and 61 deletions

View File

@@ -1,11 +1,12 @@
@using Microsoft.AspNetCore.Components.Web
@using PlaylistShared.Shared.DTO
@inject IAudioPlayerService AudioPlayerService
<MudItem @onmouseenter="HandleMouseEnter"
@onmouseleave="HandleMouseLeave"
style="position: relative; display: inline-block; cursor: pointer; border-radius: 4px; overflow: hidden;">
<MudImage Src="@CoverUrl.FormatCoverUrl(Width, Height)" Height="@Height" Width="@Width" Class="rounded" Style="display: block;" />
<MudImage Src="@Track?.CoverUri.FormatCoverUrl(Width, Height)" Height="@Height" Width="@Width" Class="rounded" Style="display: block;" />
@if (CanPlay && (_isHovered || IsCurrentTrackPlaying))
{
@@ -20,8 +21,7 @@
</MudItem>
@code {
[Parameter] public string CoverUrl { get; set; } = string.Empty;
[Parameter] public string TrackTitle { get; set; } = string.Empty;
[Parameter] public YandexTrack? Track { get; set; } = null;
[Parameter] public string TrackId { get; set; } = string.Empty;
[Parameter] public int Height { get; set; } = 50;
[Parameter] public int Width { get; set; } = 50;
@@ -53,8 +53,7 @@
await AudioPlayerService.LoadAndPlayAsync(
trackId: TrackId,
playlistShareToken: playlistShareToken,
title: TrackTitle,
coverUrl: CoverUrl);
track: Track);
}
}