Last active
August 29, 2015 14:24
-
-
Save KiranPanesar/53c2681e340cea31752a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSError *categoryError; | |
NSError *activationError; | |
AVAudioSession *audioSession = [AVAudioSession sharedInstance]; | |
BOOL successfulCategory = [audioSession setCategory:AVAudioSessionCategorySoloAmbient error:&categoryError]; | |
BOOL successfulActivation = [audioSession setActive:YES error:&activationError]; | |
NSLog(@"Category: Error: %@. Success: %@", categoryError, [NSNumber numberWithBool:successfulCategory]); | |
NSLog(@"Category: Error: %@. Success: %@", activationError, [NSNumber numberWithBool:successfulActivation]); | |
AVPlayerItem *item = [[AVPlayerItem alloc] initWithURL:[[NSBundle mainBundle] URLForResource:@"trax" | |
withExtension:@"mp3"]]; | |
player = [[AVPlayer alloc] init]; | |
[player replaceCurrentItemWithPlayerItem:item]; | |
[player play]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2015-07-13 16:02:28.912 AudioStreamingApp[5938:1005780] Category: Error: (null). Success: 1 | |
2015-07-13 16:02:28.913 AudioStreamingApp[5938:1005780] Category: Error: (null). Success: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment