提交 931eea49 编写于 作者: L Lingfeng Li 提交者: Snorlax

optimize the code for acquiring the playable duration in IJKAVMoviePlayerController (#2510)

上级 15b6df4c
......@@ -783,16 +783,15 @@ static IJKAVMoviePlayerController* instance;
NSArray *timeRangeArray = playerItem.loadedTimeRanges;
CMTime currentTime = [_player currentTime];
__block BOOL foundRange = NO;
__block CMTimeRange aTimeRange;
BOOL foundRange = NO;
CMTimeRange aTimeRange;
[timeRangeArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
if (timeRangeArray.count) {
aTimeRange = [[timeRangeArray objectAtIndex:0] CMTimeRangeValue];
if(CMTimeRangeContainsTime(aTimeRange, currentTime)) {
*stop = YES;
foundRange = YES;
}
}];
}
if (foundRange) {
CMTime maxTime = CMTimeRangeGetEnd(aTimeRange);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册