Open sou1x0 opened 7 years ago
That was using to calculate playable duration.
Although AVPlayerItem
provide a collection of time ranges for which the player has readily available, but as ijkmediaplayback all I need is the first range.
Have to say that this way of writing is somewhat ambiguous...
If the timeRangeArray's count is larger than 1, the block will run for multiple times, but actually each time the block is doing the same thing, which always acquires the first element of the array and compare it. Right?
So, why not replace the code with the following:
if (timeRangeArray.count) {
aTimeRange = [[timeRangeArray objectAtIndex:0] CMTimeRangeValue];
if(CMTimeRangeContainsTime(aTimeRange, currentTime)) {
foundRange = YES;
}
}
What do you think of it?
PR is welcome
IJKAVMoviePlayerController.m Line790
I don't know what's the
aTimeRange = [[timeRangeArray objectAtIndex:0] CMTimeRangeValue];'
means?