Skip to content

Commit

Permalink
SGPlayer: Cancel auto-paused when entered background.
Browse files Browse the repository at this point in the history
  • Loading branch information
libobjc committed Sep 27, 2019
1 parent 97c3c5b commit d429cc0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion SGPlayer/Classes/Core/SGAsset/SGSegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@

@interface SGSegment : NSObject <NSCopying>

/**
/*!
@method segmentWithDuration:
@abstract
Returns an instance of SGSegment with the given duration.
@discussion
For audio track:
*
*/
+ (instancetype)segmentWithDuration:(CMTime)duration;
Expand Down
2 changes: 1 addition & 1 deletion SGPlayer/Classes/SGPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
@property pausesWhenEnteredBackground
@abstract
Indicates whether to automatically pause when application did enter background.
Default is YES.
Default is NO.
*/
@property (nonatomic) BOOL pausesWhenEnteredBackground;

Expand Down
2 changes: 1 addition & 1 deletion SGPlayer/Classes/SGPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ - (instancetype)init
self->_notificationQueue = [NSOperationQueue mainQueue];
#if SGPLATFORM_TARGET_OS_IPHONE_OR_TV
self->_pausesWhenInterrupted = YES;
self->_pausesWhenEnteredBackground = YES;
self->_pausesWhenEnteredBackground = NO;
self->_pausesWhenEnteredBackgroundIfNoAudioTrack = YES;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(interruptionHandler:) name:AVAudioSessionInterruptionNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enterBackgroundHandler:) name:UIApplicationDidEnterBackgroundNotification object:nil];
Expand Down

0 comments on commit d429cc0

Please sign in to comment.