Streaming Seek Support
This commit is contained in:
@@ -42,7 +42,7 @@ else
|
||||
Step="0.1"
|
||||
Value="@CurrentTime"
|
||||
ValueChanged="@OnSeek"
|
||||
Disabled="@(!IsLoaded || IsStreamingMode)"/>
|
||||
Disabled="@(!CanSeek)"/>
|
||||
</div>
|
||||
|
||||
<div class="volume-right">
|
||||
@@ -77,7 +77,7 @@ else
|
||||
Step="0.1"
|
||||
Value="@CurrentTime"
|
||||
ValueChanged="@OnSeek"
|
||||
Disabled="@(!IsLoaded || IsStreamingMode)"/>
|
||||
Disabled="@(!CanSeek)"/>
|
||||
</div>
|
||||
|
||||
@* Control Buttons - positioned absolutely like original *@
|
||||
|
||||
@@ -22,6 +22,12 @@ public partial class AudioPlayerBar : ComponentBase
|
||||
private double LoadProgress => PlayerService.LoadProgress;
|
||||
private string? ErrorMessage => PlayerService.ErrorMessage;
|
||||
|
||||
/// <summary>
|
||||
/// Seek is enabled once track is loaded AND duration is known (from WAV header).
|
||||
/// This allows seeking even during streaming, including seeking beyond buffered content.
|
||||
/// </summary>
|
||||
private bool CanSeek => IsLoaded && Duration.HasValue && Duration.Value > 0;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
Reference in New Issue
Block a user