From a93d6867c55832aa1263bd38649545661cc695b8 Mon Sep 17 00:00:00 2001 From: Thong Nguyen Date: Mon, 20 Jan 2014 20:53:55 +0000 Subject: [PATCH] Made the SampleApp support background playback. Updated README to point to wiki for background playbackr --- ExampleApp/ExampleApp/AppDelegate.m | 5 +++++ ExampleApp/ExampleApp/ExampleApp-Info.plist | 4 ++++ README.md | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ExampleApp/ExampleApp/AppDelegate.m b/ExampleApp/ExampleApp/AppDelegate.m index 7e4e340..6415524 100644 --- a/ExampleApp/ExampleApp/AppDelegate.m +++ b/ExampleApp/ExampleApp/AppDelegate.m @@ -10,6 +10,7 @@ #import "STKAudioPlayer.h" #import "AudioPlayerView.h" #import "SampleQueueId.h" +#import @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]; diff --git a/ExampleApp/ExampleApp/ExampleApp-Info.plist b/ExampleApp/ExampleApp/ExampleApp-Info.plist index c56a53f..f2f0135 100644 --- a/ExampleApp/ExampleApp/ExampleApp-Info.plist +++ b/ExampleApp/ExampleApp/ExampleApp-Info.plist @@ -24,6 +24,10 @@ 1.0 LSRequiresIPhoneOS + UIBackgroundModes + + audio + UIRequiredDeviceCapabilities armv7 diff --git a/README.md b/README.md index 468af4a..d81a63b 100644 --- a/README.md +++ b/README.md @@ -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)