提交 297829e7 编写于 作者: Y yuvesy@yuvesy.com

ios9 avplayer background play

上级 a4957b95
......@@ -73,6 +73,7 @@
#import "IJKMediaModule.h"
#import "IJKMediaUtils.h"
#import "IJKKVOController.h"
#include "ijksdl/ios/ijksdl_ios.h"
// avoid float equal compare
static const float kMinPlayingRate = 0.00001f;
......@@ -1004,6 +1005,13 @@ static IJKAVMoviePlayerController* instance;
} else {
if (![self airPlayMediaActive]) {
[_avView setPlayer:nil];
if (isIOS9OrLater()) {
if ([self isPlaying]) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self play];
});
}
}
}
}
}
......
......@@ -33,6 +33,11 @@
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
inline static BOOL isIOS9OrLater()
{
return SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0");
}
inline static BOOL isIOS8OrLater()
{
return SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册