Skip to main content
Participant
April 1, 2009
Question

volume control of netStream

  • April 1, 2009
  • 2 replies
  • 1580 views
Hello Guys,

I am playing a video through net stream and its working fine. I can control play, pause, stop etc. But now i would like to control the volume of the video which is playing through net stream. Please check the below code to have a idea what i am doing.
-------------------------------------------------------------------------------------------------
_ns = new NetStream( _nc );
_videoObj.attachNetStream( _ns );

where ...
_nc = net connection
_ns = net stream
_videoObj = video
-------------------------------------------------------------------------------------------------
Thanks,
Amit
    This topic has been closed for replies.

    2 replies

    April 3, 2009
    You need to create a soundTransform instance ( new SoundTransform), and then assign that to the value of ns.soundTransform.

    var st = new SoundTransform();
    ns.soundTransform = st;

    then, when you change properties of the sound transform, you need to reapply it to the ns

    function changeVolume(vol){
    st.volume = vol;
    ns.soundTransform = st;
    }

    April 2, 2009
    You use the soundTransform property of the NetStream. See the docs for the SoundTransform class.
    Amit_FxAuthor
    Participant
    April 3, 2009
    Thanks a lot for your reply. Yes i did it before but no change in volume. Below is the code.

    _ns.soundTransform.volume = 0;

    where _ns = net steram.

    Please help.

    Thanks,
    Amit