Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
修复第二次播放黑屏的问题 (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richasy authored Apr 5, 2022
1 parent 08ecef9 commit 281b3de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ private async Task InitializeOnlineDashVideoAsync()
{
try
{
if (!AppViewModel.Instance.IsOpenPlayer)
{
return;
}

var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Referer = new Uri("https://www.bilibili.com");
httpClient.DefaultRequestHeaders.Add("User-Agent", ServiceConstants.DefaultUserAgentString);
Expand Down Expand Up @@ -104,6 +109,11 @@ private async Task InitializeLiveDashAsync(string url)
{
try
{
if (!AppViewModel.Instance.IsOpenPlayer)
{
return;
}

if (_interopMSS != null)
{
_interopMSS.Dispose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ public async Task LoadAsync(CurrentPlayingRecord record, bool isRefresh = false,
}

AppViewModel.Instance.CanShowHomeButton = _historyVideoList.Count > 0;

switch (_videoType)
{
case VideoType.Video:
Expand Down Expand Up @@ -594,6 +593,7 @@ public void ClearPlayer()
}

_currentVideoPlayer.Source = null;
_currentVideoPlayer = null;
}

_lastReportProgress = TimeSpan.Zero;
Expand Down

0 comments on commit 281b3de

Please sign in to comment.