Skip to content

Commit

Permalink
优化直播停止后播放器的提示文本
Browse files Browse the repository at this point in the history
  • Loading branch information
CHKZL committed Jun 23, 2024
1 parent b7e871b commit 6d511eb
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Desktop/Views/Windows/VlcPlayWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,21 @@ await Task.Run(() =>
CancellationTokenSource cts = new CancellationTokenSource();
Task task = Task.Run(() =>
{
var media = new Media(_libVLC, Url, FromType.FromLocation);
_mediaPlayer.Media = media;
_mediaPlayer.Play();
if (_libVLC != null && !string.IsNullOrEmpty(Url))
{
var media = new Media(_libVLC, Url, FromType.FromLocation);
_mediaPlayer.Media = media;
_mediaPlayer?.Play();
}
else
{
vlcPlayModels.MessageVisibility = Visibility.Visible;
vlcPlayModels.OnPropertyChanged("MessageVisibility");
vlcPlayModels.MessageText = "直播间已下拨获取地址失败,如需更新请右键刷新";
vlcPlayModels.OnPropertyChanged("MessageText");
return;
}
}, cts.Token);
if (!task.Wait(TimeSpan.FromSeconds(10)))
Expand Down

0 comments on commit 6d511eb

Please sign in to comment.