How to mute video in widget?

I trying to mute a video I play from a widget. The setup is simple like any other. I have an image widget that uses a media texture. I have a media player that projects to the media texture. I have a media source that can be opened and played by the media player. The blueprint is also straightforward. The sound is automatically played after I open the source.

image

I would like to toggle mute on this video in a way that does not involve splitting the video and the sound into 2 files.

I tried to assign the media player to a media sound component that has a custom sound class, adjust volume, set volume multiplier and override sound mix but no luck.

void SetupMediaPlayer(UMediaPlayer* const& InPlayer, USoundClass* const InSoundClass) noexcept
{
	const auto& sound{ GetWorld()->SpawnActor<AMediaActor>()->sound }; // media sound component
	sound->SoundClass = InSoundClass;
	sound->SetMediaPlayer(InPlayer);
	sound->AdjustVolume(0.f, 0.f);
	sound->SetVolumeMultiplier(0.f);
}

image image

Does anybody know a solution for this?

There was a media sound component somewhere else overriding the volume of this player so I could not mute it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.