Создание своего прогресса загрузки трека

This commit is contained in:
FrigaT
2026-04-16 04:35:05 +03:00
parent 35140b71b7
commit 41a9d27005
2 changed files with 146 additions and 1 deletions

View File

@@ -39,6 +39,12 @@
</MudStack>
<MudSlider Value="@AudioPlayerService.CurrentProgress" Class="mt-n1" Min="0" Max="100" Size="Size.Small" ValueChanged="@((double newValue) => SeekTo(newValue))" Step="0.01" />
<MudProgressLinear Color="Color.Primary" Buffer="true" Value="@AudioPlayerService.CurrentProgress" BufferValue="@_bufferValue" Class="my-7" />
<TrackProgress Value="@AudioPlayerService.CurrentProgress"
Min="0"
Max="100"
Color="Color.Primary"
BufferValue="@_bufferValue" />
</MudStack>
<!-- Громкость -->
@@ -60,6 +66,7 @@
Class="pa-0 mt-n5"
Style="height:120px; width: 10px; background-color: transparent !important; overflow: visible !important;">
<MudProgressLinear Vertical="true" Color="Color.Primary" Size="Size.Medium" Value="@AudioPlayerService.CurrentVolume" />
</MudPopover>
</MudItem>
</MudStack>
@@ -78,6 +85,7 @@
// Громкость
private bool _volumeIsOpen;
private double _volumeBeforeMute;
private double _bufferValue;
private bool _isPlayHovered;
@@ -125,7 +133,7 @@
[JSInvokable]
public async Task OnDownloadProgress(double second)
{
var x = second;
_bufferValue = second / AudioPlayerService.TotalTime * 100;
}
private async Task<bool> CheckAuthAsync()