Search Unity

Video Can you mute a video player while its running?

Discussion in 'Audio & Video' started by JosukeHigishikata, Mar 26, 2020.

  1. JosukeHigishikata

    JosukeHigishikata

    Joined:
    Mar 25, 2020
    Posts:
    3
    i want to know since i want my game to have TVs you can destroy to shut them off and show a broken screen. but, whenever i destroy them it doesn't stop playing audio
     
  2. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hi!

    Audio from a movie continuing to play when the VideoPlayer playing this movie gets destroyed is certainly not the intended behaviour! Can you explain how you're destroying the VideoPlayer? If you're just destroying the geometry on which the movie is played, but the VideoPlayer sits on another - not destroyed - game object, then it'd explain what you are describing. The VideoPlayer doesn't track the life scope of the targeted render texture/material/object/camera so depending on your setup you may need to deal with this manually.

    In any event, calling VideoPlayer.Stop() explicitly will do the trick.

    Dominique Leroux
    A/V developer at Unity