Search code examples
audioapache-flexvideo-player

flex how to control the audio volume of a video


I have code like this:

 private var video:Video;
  ...
 private function init():void {
           ...

            nc = new NetConnection();
            nc.connect(null);

            ns = new NetStream(nc);
            ns.play("my flv url");
            ns.client = nsClient;

            video = new Video();
            video.attachNetStream(ns);
            videoDisplay.addChild(video);
        }

Which property should I change or bind a slider to in order to be able to change the sound volume?


Solution

  • you can set it like this in AS3 VideoDisplay.voulme = 0.5;

    else in MXML style you can do as shown here along with a binded slider.

    http://blog.flexexamples.com/2008/08/24/setting-the-volume-on-a-videodisplay-control-in-flex/#more-762