Made the SampleApp support background playback. Updated README to point to wiki for background playbackr

This commit is contained in:
Thong Nguyen 2014-01-20 20:53:55 +00:00
parent 4660f0ce80
commit a93d6867c5
3 changed files with 11 additions and 2 deletions

View File

@ -10,6 +10,7 @@
#import "STKAudioPlayer.h"
#import "AudioPlayerView.h"
#import "SampleQueueId.h"
#import <AVFoundation/AVFoundation.h>
@interface AppDelegate()
{
@ -22,6 +23,10 @@
-(BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
NSError* error;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&error];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];

View File

@ -24,6 +24,10 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>

View File

@ -36,9 +36,9 @@ audioPlayer.delegate = self;
```
## Background Playback
## More
Background playback on iOS is easily added to your application by calling the `AudioSessionInitialize` in your AppDelegate and adding audio to the `UIBackgroundModes` key in your plist file.
More documentation is available on the project [wiki](wiki)
### Authors and Contributors
Copyright (c) 2012-2014, Thong Nguyen (@tumtumtum)