开发者

can i control over all volume of iphone using iphone app

开发者 https://www.devze.com 2023-03-09 15:19 出处:网络
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 ch

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

精彩评论

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