Closed ashleyevans closed 2 years ago
You need to make some modifications to iPhoneStreamingPlayerViewController.m so that the streamer can respond to play/pause events from Control Centre
It needs to declare in the ViewDidLoad:
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[self becomeFirstResponder];
You also need to add the canBecomeFirestResponder method and set it to return true, and in viewWillDisappear:
[[UIApplication sharedApplication] endReceivingRemoteControlEvents];
[self resignFirstResponder];
You'll also need a - (void) ReceivedWithEvent:(UIEvent *)event method somewhere in the class to handle those play/pause/stop events.
I've tested background mode and phone call interruptions and both seem stable to me but would appreciate some more testing
changes made were based on the work by http://github.com/software-mariodiana/AudioBufferPlayer/wiki/Replacing-C-functions-deprecated-in-iOS-7