Fixed background music playing momentarily in AssetBrowser when switching to a video asset

This commit is contained in:
penev92
2022-01-04 23:14:40 +02:00
committed by Matthias Mailänder
parent 001efc9409
commit 631297417c

View File

@@ -500,12 +500,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
} }
else if (allowedVideoExtensions.Contains(fileExtension)) else if (allowedVideoExtensions.Contains(fileExtension))
{ {
// Mute music so it doesn't interfere with the current asset.
MuteSounds();
var video = VideoLoader.GetVideo(Game.ModData.DefaultFileSystem.Open(filename), Game.ModData.VideoLoaders); var video = VideoLoader.GetVideo(Game.ModData.DefaultFileSystem.Open(filename), Game.ModData.VideoLoaders);
if (video != null) if (video != null)
{ {
// Mute music so it doesn't interfere with the current asset.
MuteSounds();
player = panel.Get<VideoPlayerWidget>("PLAYER"); player = panel.Get<VideoPlayerWidget>("PLAYER");
player.Load(prefix + filename); player.Load(prefix + filename);
player.DrawOverlay = false; player.DrawOverlay = false;