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

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