有没有办法更改/设置我在iOS的Flex 4.6中添加到StageVideo的视频的音量?
我将一个netstream添加到StageVideo。当我更改soundTransform音量时,设备上的音量完全不变。

即使设置了SoundMixer soundtransform-volume,它在设备上也不会更改。

我认为可以通过在iOS设备上设置netStream的音量来解决问题,但是我找不到确切的问题。

提前致谢!

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);

最佳答案

您将需要使用本机扩展来控制iOS音量。我建议使用Volume Native扩展名https://github.com/nweber/SystemVolumeNativeExtension。一个简单的示例将“音量”(值)设置为中间值:

VolumeController.instance.setVolume( 0.5 )

关于ios - 在iOS上的Flex中更改StageVideo的音量,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10981226/

10-15 16:05