2

Is there a way to change/set the volume of a video I added to the StageVideo in Flex 4.6 for iOS? I add a netstream to the StageVideo. When I change the soundTransform volume, the volume on my device doesn't change at all.

Even when I set the SoundMixer soundtransform-volume it doesn't change on the device.

I think there is a little issue by setting the volume of the netStream on a iOS device, but I can't locate the exact problem.

Thanks in advance!

var videoPath:String = "mymovie.mp4";                   
var netConnection:NetConnection = new NetConnection();
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnectionStatusHandler);
netConnection.connect(null);

var netStream:NetStream = new NetStream(netConnection);
netStream.addEventListener(NetStatusEvent.NET_STATUS, netStreamStatusHandler);
netStream.play(videoPath);

var obj:Object = new Object();                  
netStream.client = obj;                 
netStream.soundTransform = new SoundTransform(0);           
obj.onMetaData = onMetaData;

var vidDisplay:StageVideo = stage.stageVideos[0];                   
vidDisplay.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageWidth);
vidDisplay.attachNetStream(netStream);

1 Answers1

0

You would need to use a Native Extension to control the iOS volume. I recommend Volume Native extension https://github.com/nweber/SystemVolumeNativeExtension. An easy example to set the Volume's (value) to mid way:

VolumeController.instance.setVolume( 0.5 )
Yozef
  • 829
  • 11
  • 27