UnityPlugin-AVProVideo
UnityPlugin-AVProVideo copied to clipboard
Setting mediaPlayer.AudioMuted = true not working. Have to make SetPlaybackOptions public and call from mediaPlayer.Events.AddListener
Describe the issue Setting mediaPlayer.AudioMuted = true not working for videos opened afterwards with mediaPlayer.OpenMedia(new MediaPath(...)).
Have to make SetPlaybackOptions public in MediaPlayer.cs and call from a listener (added with mediaPlayer.Events.AddListener()) to make it work. Which is ok. But I thought it useful to report the issue, so it can be fixed, and others can work around it in the meantime.
More info:
SetPlaybackOptions() is called when opening the new media. I tested that.
Looks like something isn't loaded yet when SetPlaybackOptions() is called. I checked and the _controlInterface is not null, and set to Windows Media player. So that can't be it. Must be something internal in Windows Media Player that makes a call to SetPlaybackOptions not do its job early on.
Symptoms:
In the Editor UI the AudioMuted is ticked but audio is playing. When manually setting it, it works, but then doesn't when a new video comes on. Also tried to set the volume to 0f. Which doesn't work when set through code. It does when touched on the Edutor UI (both do). But it does not carry to the next video opened. So the above manual call once the FirstFrameReady event type is there is the only workaround for now.
Same issue exists with the PlaylistMediaPlayer. Even when both MediaPlayers have their AudioMuted set to true as well, in addition to the PlaylistMediaPlayers AudioMuted being true.
Your Setup (please complete the following information):
- Unity version: 6
- AVPro Video version (number and edition (trial/core/ultra/enterprise)): Core. Latest.
- Operating system version: Win 10
- Device model: PC
- Video specs (resolution, frame-rate, codec, file size): HD, nothing special
To Reproduce
- Create a mediaPlayer through code and set mediaPlayer.AutoMuted = true
- Open one or more videos with mediaPlayer.OpenMedia(new MediaPath(...)).
- Hear the audio, which should have been muted