- Home /
How to Change Volume for VideoPlayer with AudioSource Audio Output Mode
I've got a video player using an AudioSource for its Audio Output Mode. I want to be able to adjust the volume via script. SetDirectAudioVolume doesn't work because it's not using the Direct output mode, and if I try to adjust the AudioSource volume directly, it gets automatically reset to 1 whenever I play the scene.
So how do I adjust the volume?
We are creating virtual music videos and performances with Unity. This question regarding audio control with video content is a highly relevant one for us. We need the ability to start/stop and scrub the video back and forth, as well being able to turn the audio portion of the video on/off as well as fade the volume in/out while the video is playing. Do such level of control exist as part of the VideoPlayer? If not, how can it be achieved? Thank you ahead for the help!
Answer by oddalicious · Feb 08, 2018 at 02:17 AM
While this likely won't help the person who asked the question, we fixed ours by just modifying the volume of the AudioSource (audioSourceVariable.volume = x;) whenever the video plays (line above Play()), and it works for us. Responding here as it's the top hit when searching 'change volume VideoPlayer Unity'
Your answer
Follow this Question
Related Questions
Unity 3d which format of video support? 1 Answer
Play, seek a video 1 Answer
How can we get the current video time for scrubbing? 0 Answers
Play High Quality Video in Unity 2 Answers
Make Unity delay frame until VideoPlayer seek completed 0 Answers