From c899dd0be562ea9f3ab3be530b6efbe52c78acdd Mon Sep 17 00:00:00 2001 From: Richasy Date: Sun, 17 Jan 2021 11:49:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E8=A7=86=E9=A2=91=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=90=8E=E5=8E=BB=E9=99=A4=E5=B0=81=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BiliBili-UWP/BiliBili-UWP.csproj | 2 +- BiliBili-UWP/Components/Controls/VideoPlayer.xaml.cs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/BiliBili-UWP/BiliBili-UWP.csproj b/BiliBili-UWP/BiliBili-UWP.csproj index 92b9a74..1133447 100644 --- a/BiliBili-UWP/BiliBili-UWP.csproj +++ b/BiliBili-UWP/BiliBili-UWP.csproj @@ -24,7 +24,7 @@ D:\Package\BiliBili\ False Always - x86|x64|arm|arm64 + arm64 0 True 19DE3251AB16B9B0D867892B047B3BB7FF135FF9 diff --git a/BiliBili-UWP/Components/Controls/VideoPlayer.xaml.cs b/BiliBili-UWP/Components/Controls/VideoPlayer.xaml.cs index 82838b2..3d56f05 100644 --- a/BiliBili-UWP/Components/Controls/VideoPlayer.xaml.cs +++ b/BiliBili-UWP/Components/Controls/VideoPlayer.xaml.cs @@ -531,6 +531,7 @@ public async Task RefreshVideoSource(int partId, int progress = 0, bool needRefr VideoMTC.IsInit = true; if (_player.AutoPlay) Resume(); + //mediaElement.PosterSource = null; } else ErrorContainer.Visibility = Visibility.Visible; @@ -607,6 +608,7 @@ public async Task RefreshVideoSource(Episode part, bool isRefresh = false, int p VideoMTC.IsInit = true; if (_player.AutoPlay) Resume(); + mediaElement.PosterSource = null; } else { @@ -1119,7 +1121,7 @@ private async Task HandleDashSource() video = data.dash.video.OrderByDescending(p => p.id).FirstOrDefault(p => p.codecid == 7); var audio = data.dash.audio?.FirstOrDefault(); // 遇到新的电影时,可能出现HEVC音频源,若系统未安装相应解码器,则会解码失败,没有声音 - if (!isHevc && data.dash.audio.Any(p=>p.codecs.Contains("mp4a"))) + if (!isHevc && data.dash.audio.Any(p => p.codecs.Contains("mp4a"))) audio = data.dash.audio.Where(p => p.codecs.Contains("mp4a")).FirstOrDefault(); MediaSource source = null; if (isBangumi) @@ -1576,12 +1578,12 @@ public bool AutoLoop // Using a DependencyProperty as the backing store for AutoLoop. This enables animation, styling, binding, etc... public static readonly DependencyProperty AutoLoopProperty = - DependencyProperty.Register("AutoLoop", typeof(bool), typeof(VideoPlayer), new PropertyMetadata(false,new PropertyChangedCallback(AutoLoop_Changed))); + DependencyProperty.Register("AutoLoop", typeof(bool), typeof(VideoPlayer), new PropertyMetadata(false, new PropertyChangedCallback(AutoLoop_Changed))); private static void AutoLoop_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e) { var instance = d as VideoPlayer; - if(instance._player!=null) + if (instance._player != null) instance._player.IsLoopingEnabled = (bool)e.NewValue; } @@ -1625,7 +1627,7 @@ private void DefaultTimer_Tick(object sender, object e) //弹幕加载 if (DanmakuControls == null) return; - if (mediaElement.MediaPlayer!=null && mediaElement.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing && DanmakuList.Count > 0) + if (mediaElement.MediaPlayer != null && mediaElement.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing && DanmakuList.Count > 0) { int nowDanmaNum = 0; var currentPosition = mediaElement.MediaPlayer.PlaybackSession.Position.TotalSeconds; @@ -1731,7 +1733,7 @@ private void FontInit() public async void ResetDanmakuStatus() { bool isShow = AppTool.GetBoolSetting(Settings.IsDanmakuOpen); - if (isShow && DanmakuControls!=null) + if (isShow && DanmakuControls != null) { DanmakuControls.Width = 100; await Task.Delay(100);