Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 WebDAV 空格没有暂停的问题 #674

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ private void CreateOverlayContainer()
_danmakuControl = _createDanmakuControlFunc?.Invoke() ?? default;
if (_danmakuControl is not null)
{
_danmakuControl.Margin = new Thickness(3, 4, 12, 12);
_danmakuControl.HorizontalAlignment = HorizontalAlignment.Stretch;
_danmakuControl.VerticalAlignment = VerticalAlignment.Stretch;
rootGrid.Children.Add(_danmakuControl);
Expand Down
5 changes: 5 additions & 0 deletions src/Desktop/BiliCopilot.UI/Controls/RootLayout.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ public bool TryTogglePlayPauseIfInPlayer()
lPage.ViewModel.Player.TogglePlayPauseCommand.Execute(default);
return true;
}
else if (OverlayFrame.Content is WebDavPlayerPage wPage)
{
wPage.ViewModel.Player.TogglePlayPauseCommand.Execute(default);
return true;
}

return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,16 @@ private void OnStateChanged(object? sender, PlaybackStateChangedEventArgs e)
}

private void OnPlaybackStopped(object? sender, PlaybackStoppedEventArgs e)
=> ReachEnd();
{
if (Math.Abs(Position - Duration) < 5)
{
ReachEnd();
}
else
{
UpdateState(PlayerState.Paused);
}
}

private async void OnLogMessageReceivedAsync(object? sender, LogMessageReceivedEventArgs e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,16 @@ private void OnStateChanged(object? sender, PlaybackStateChangedEventArgs e)
}

private void OnPlaybackStopped(object? sender, PlaybackStoppedEventArgs e)
=> ReachEnd();
{
if (Math.Abs(Position - Duration) < 5)
{
ReachEnd();
}
else
{
UpdateState(PlayerState.Paused);
}
}

private async void OnLogMessageReceivedAsync(object? sender, LogMessageReceivedEventArgs e)
{
Expand Down
Loading