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

添加播放封面 #700

Merged
merged 1 commit into from
Sep 29, 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 @@ -11,7 +11,13 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid x:Name="RootGrid" Margin="0,0,-2,-2">
<Grid x:Name="RootGrid" Background="Black">
<Image
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Source="{x:Bind ViewModel.Cover, Mode=OneWay, Converter={StaticResource BitmapConverter}}"
Stretch="Uniform"
Visibility="{x:Bind ViewModel.Cover, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}" />
<local:PlayerPresenter x:Name="PlayerPresenter" />
<Grid x:Name="HiddenControlsContainer">
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ public abstract partial class PlayerViewModelBase
[ObservableProperty]
private bool _isAmdMpvWarningShown;

[ObservableProperty]
private Uri? _cover;

/// <summary>
/// 播放数据加载完成.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public void InitializeSmtc(string cover, string title, string subtitle)
return;
}

if (!string.IsNullOrEmpty(cover))
{
Cover = new Uri(cover);
}

var updater = _smtc.DisplayUpdater;
updater.ClearAll();
updater.Type = MediaPlaybackType.Video;
Expand Down
Loading