提交 3b63d994 编写于 作者: X xinzhengzhang 提交者: Zhang Rui

ios/IJKAVMoviePlayer set screen close when playing was interrupted

上级 ddef043c
...@@ -232,7 +232,6 @@ static IJKAVMoviePlayerController* instance; ...@@ -232,7 +232,6 @@ static IJKAVMoviePlayerController* instance;
- (void)setScreenOn: (BOOL)on - (void)setScreenOn: (BOOL)on
{ {
[IJKMediaModule sharedModule].mediaModuleIdleTimerDisabled = on; [IJKMediaModule sharedModule].mediaModuleIdleTimerDisabled = on;
// [UIApplication sharedApplication].idleTimerDisabled = on;
} }
- (void)dealloc - (void)dealloc
...@@ -274,6 +273,7 @@ static IJKAVMoviePlayerController* instance; ...@@ -274,6 +273,7 @@ static IJKAVMoviePlayerController* instance;
- (void)stop - (void)stop
{ {
[_player pause]; [_player pause];
[self setScreenOn:NO];
_isCompleted = YES; _isCompleted = YES;
} }
...@@ -644,7 +644,8 @@ static IJKAVMoviePlayerController* instance; ...@@ -644,7 +644,8 @@ static IJKAVMoviePlayerController* instance;
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self didPlaybackStateChange]; [self didPlaybackStateChange];
[self didLoadStateChange]; [self didLoadStateChange];
[self setScreenOn:NO];
if (blockError == nil) { if (blockError == nil) {
blockError = [[NSError alloc] init]; blockError = [[NSError alloc] init];
} }
...@@ -685,7 +686,8 @@ static IJKAVMoviePlayerController* instance; ...@@ -685,7 +686,8 @@ static IJKAVMoviePlayerController* instance;
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self didPlaybackStateChange]; [self didPlaybackStateChange];
[self didLoadStateChange]; [self didLoadStateChange];
[self setScreenOn:NO];
[[NSNotificationCenter defaultCenter] [[NSNotificationCenter defaultCenter]
postNotificationName:IJKMPMoviePlayerPlaybackDidFinishNotification postNotificationName:IJKMPMoviePlayerPlaybackDidFinishNotification
object:self object:self
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册