Skip to content

Commit

Permalink
给Desktop增加兼容播放模式
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Jan 10, 2025
1 parent e0d526a commit 566f685
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Desktop/Views/Control/CardControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
<UserControl.Resources>
<ContextMenu x:Key="CardContextMenu">
<MenuItem Header="打开窗口观看" Click="MenuItem_PlayWindow_Click"/>
<MenuItem Header="打开兼容播放窗口观看" Click="MenuItem_Compatible_PlayWindow_Click" ToolTipService.InitialShowDelay="100" ToolTipService.Placement="MousePoint" ToolTipService.ToolTip="用于网络不稳定或者标准窗口加载不出来直播画面的情况"/>
<Separator />
<MenuItem Header="单独打开弹幕查看器" Click="MenuItem_DanmaOnly_Click"/>
<MenuItem Header="在浏览器打开直播间" Click="MenuItem_OpenLiveUlr_Click"/>

<Separator />
<MenuItem Header="切换录制设置" Click="MenuItem_ModifyRoom_AutoRec_Click"/>
<MenuItem Header="切换弹幕设置" Click="MenuItem_ModifyRoom_Danmu_Click"/>
Expand Down
11 changes: 11 additions & 0 deletions Desktop/Views/Control/CardControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Core;
using Core.LogModule;
using Core.RuntimeObject;
using Desktop.Models;
using Desktop.Views.Windows;
using System.Diagnostics;
using System.Windows;
Expand Down Expand Up @@ -214,5 +215,15 @@ private void Snapshot_Task_Click(object sender, RoutedEventArgs e)
}
});
}

private void MenuItem_Compatible_PlayWindow_Click(object sender, RoutedEventArgs e)
{
Models.DataCard dataCard = GetDataCard(sender);
Dispatcher.Invoke(() =>
{
Windows.WebPlayWindow WebPlayWindow = new Windows.WebPlayWindow(dataCard.Room_Id);
WebPlayWindow.Show();
});
}
}
}
2 changes: 1 addition & 1 deletion Desktop/Views/Windows/WebPlayWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public WebPlayWindow(long room_id)
Dispatcher.Invoke(() =>
{
this.Title = RoomInfo.GetTitle(_uid);
UI_TitleBar.Title = $"{_nickname}({_room_id}) - {this.Title}(该直播间只有FLV流,使用WEB兼容模式播放)";
UI_TitleBar.Title = $"{_nickname}({_room_id}) - {this.Title}【WEB兼容模式】(可能由于该直播间只有FLV流或者网络质量不佳)";
});
});

Expand Down

0 comments on commit 566f685

Please sign in to comment.