Skip to content

Commit

Permalink
set tookAudioFocus flag and deactive AudioSession when player deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
saiday committed Nov 7, 2014
1 parent f7d72c9 commit 21a3351
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions HysteriaPlayer/HysteriaPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ - (NSUInteger)randomIndex

- (void)deprecatePlayer
{
NSError *error;
self.tookAudioFocus = NO;
[[AVAudioSession sharedInstance] setActive:NO error:&error];
[[UIApplication sharedApplication] endReceivingRemoteControlEvents];
[[NSNotificationCenter defaultCenter]removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:nil];

Expand Down

0 comments on commit 21a3351

Please sign in to comment.