From 20b7f8cd593af8c1419d72badde17763c069d3f8 Mon Sep 17 00:00:00 2001 From: ywmoyue Date: Sat, 21 Sep 2024 21:02:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E6=8E=A7=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=AB=A0=E8=8A=82=E7=9C=8B=E7=82=B9=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Icon/icon_view_point.png | Bin 0 -> 2413 bytes src/BiliLite.UWP/BiliLite.UWP.csproj | 1 + src/BiliLite.UWP/Controls/PlayerControl.xaml | 61 +++++++++++++++--- .../Controls/PlayerControl.xaml.cs | 24 ++++++- src/BiliLite.UWP/Modules/Player/PlayerVM.cs | 22 +++++++ .../ViewModels/PlayControlViewModel.cs | 7 ++ 6 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 src/BiliLite.UWP/Assets/Icon/icon_view_point.png diff --git a/src/BiliLite.UWP/Assets/Icon/icon_view_point.png b/src/BiliLite.UWP/Assets/Icon/icon_view_point.png new file mode 100644 index 0000000000000000000000000000000000000000..29d825be8b77b4adaf4865d94e1110fe5e2b2531 GIT binary patch literal 2413 zcmeHJ`BPI@6b_j@LxN~XpAZq`fiMuzFhP+}S$s5vB?!pAyMR>|QHV4mYaT8!MvbDf zg965&0urPGDzP<46ft5zq-7Npt+-%`L}cmnkLYjCUCzvR&OP(p@18qzj{Ez1=n@Ty z7z{?&%aa*^TE+LJy#(EB!|KXWqs0mEaKqF+F?x%^5G=izaL~b+_hqALJs}jJ!kTaZ zdme)hoHZec%&pYuInrHXGG^ZI`DhtGjc4Ga*&O>fs>ptyt}R$H!)yE5lQ{GJ#kt7A zG|v$LOMLmtR126g6y2j}eS~5M2Hrt9a2#^aD2~N}al(=e zNdBTc@O}I#J%15B`9m5BOH372I(N~rCHisY6Araa+}bAB3#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>=yPn(ipr!NXx>UBDOreR)-=yvhT3uc?Ub}5YkMEq0#rzm z+##`H*4SlJJ^e-Zg;oSx7lwEQ-x8MFn$!%?j~g$8XN zySmW8knc_ldijayDb%S2qzGFtftJimp)wFhlGCl%J`kYHqfGg+L3DZuMFx($!A4aZ zA%KB0E6Kje&9^bYCe-%j^t<}aAG z<7FE=%N9N_pBS`QyxnVPskb=Vn^=0ThQ8o^3I zOH@}|VTo>MHta4y+mM2$Ljj-`aLKc{k&PuvJ0qN_f?UMkysO_r3+UffTMoK!hON%N ko;;h2OiDxi1ZJO>OFIqi>V0!f(f$eJ + diff --git a/src/BiliLite.UWP/Controls/PlayerControl.xaml b/src/BiliLite.UWP/Controls/PlayerControl.xaml index 30bc4d2be..cd047621e 100644 --- a/src/BiliLite.UWP/Controls/PlayerControl.xaml +++ b/src/BiliLite.UWP/Controls/PlayerControl.xaml @@ -13,6 +13,7 @@ xmlns:fa="using:FontAwesome5" xmlns:player="using:BiliLite.Modules.Player" xmlns:common="using:BiliLite.Models.Common" xmlns:player1="using:BiliLite.Models.Common.Player" + xmlns:modules="using:BiliLite.Modules" d:DesignHeight="800" d:DesignWidth="1000"> @@ -410,7 +411,7 @@ 弹幕同屏密度(0为不限制) - 弹幕字体 + 弹幕字体 @@ -446,7 +447,7 @@ 合并重复弹幕 - + 屏蔽等级(0为不屏蔽) @@ -605,10 +606,10 @@ DoubleTapped="Grid_DoubleTapped"> - + - + @@ -666,7 +667,7 @@ - + @@ -702,9 +703,15 @@ 第一集 + + + diff --git a/src/BiliLite.UWP/Controls/PlayerControl.xaml.cs b/src/BiliLite.UWP/Controls/PlayerControl.xaml.cs index a0a9e07e3..a034e034e 100644 --- a/src/BiliLite.UWP/Controls/PlayerControl.xaml.cs +++ b/src/BiliLite.UWP/Controls/PlayerControl.xaml.cs @@ -1506,8 +1506,13 @@ private async Task GetPlayerInfo() } } - TopOnline.Text = await playerHelper.GetOnline(CurrentPlayItem.avid, CurrentPlayItem.cid); + if (player_info.ViewPoints != null && player_info.ViewPoints.Any()) + { + m_viewModel.ViewPoints = player_info.ViewPoints; + m_viewModel.ShowViewPointsBtn = true; + } + TopOnline.Text = await playerHelper.GetOnline(CurrentPlayItem.avid, CurrentPlayItem.cid); } public async Task ReportHistory(double progress = double.NaN) @@ -2914,5 +2919,22 @@ private void Player_SizeChanged(object sender, SizeChangedEventArgs e) // 更新画面比例 Player.SetRatioMode(PlayerSettingRatio.SelectedIndex); } + + private void TopBtnViewPoints_OnClick(object sender, RoutedEventArgs e) + { + m_viewModel.ShowViewPointsView = true; + } + + private void ViewPointsGrid_OnTapped(object sender, TappedRoutedEventArgs e) + { + m_viewModel.ShowViewPointsView = false; + } + + private void ViewPoint_OnTapped(object sender, TappedRoutedEventArgs e) + { + if (!(sender is FrameworkElement element)) return; + if (!(element.DataContext is PlayerInfoViewPoint viewPoint)) return; + SetPosition(viewPoint.From); + } } } diff --git a/src/BiliLite.UWP/Modules/Player/PlayerVM.cs b/src/BiliLite.UWP/Modules/Player/PlayerVM.cs index 9d05b1432..fad2e140f 100644 --- a/src/BiliLite.UWP/Modules/Player/PlayerVM.cs +++ b/src/BiliLite.UWP/Modules/Player/PlayerVM.cs @@ -285,7 +285,29 @@ public class PlayerInfo /// 互动视频信息 /// public InteractionModel interaction { get; set; } + + /// + /// 章节看点信息 + /// + [JsonProperty("view_points")] + public List ViewPoints { get; set; } + } + + public class PlayerInfoViewPoint + { + public int Type { get; set; } + + public long From { get; set; } + + public long To { get; set; } + + public string Content { get; set; } + + public string ImgUrl { get; set; } + + public string LogoUrl { get; set; } } + public class PlayerOnlineInfo { public string total { get; set; } diff --git a/src/BiliLite.UWP/ViewModels/PlayControlViewModel.cs b/src/BiliLite.UWP/ViewModels/PlayControlViewModel.cs index 51c83a869..4fe6299f0 100644 --- a/src/BiliLite.UWP/ViewModels/PlayControlViewModel.cs +++ b/src/BiliLite.UWP/ViewModels/PlayControlViewModel.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using BiliLite.Models.Common; using BiliLite.Services; +using BiliLite.Modules; namespace BiliLite.ViewModels { @@ -13,5 +14,11 @@ public class PlayControlViewModel: BaseViewModel public bool ShowVideoBottomVirtualProgressBar => SettingService.GetValue(SettingConstants.UI.SHOW_VIDEO_BOTTOM_VIRTUAL_PROGRESS_BAR, SettingConstants.UI.DEFAULT_SHOW_VIDEO_BOTTOM_VIRTUAL_PROGRESS_BAR); + + public bool ShowViewPointsView { get; set; } + + public bool ShowViewPointsBtn { get; set; } + + public List ViewPoints { get; set; } } }