开发者

can i control over all volume of iphone using iphone app

Can I co开发者_JS百科ntrol over all volume of iPhone using my app ? Because I want to control the volume of all play back apps


It appears possible at least on some versions: see Using a UISlider to change volume


MPVolumeView gives you an on screen control to display and control the system volume. This has the advantage of other approaches that it will also allow you to control which airplay device to stream the audio too. Here is an example of how to add it to your view hierarchy.

MPVolumeView *volumeView = [[[MPVolumeView alloc] initWithFrame: volumeViewRect] autorelease];
[self.view addSubview: myVolumeView];


If you are using AVAudioPlayer to play this, then just use the

[audio stop];

Method in order to pause after one minute (maybe hook it up to a NSTimer).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜