Implement bufferedPosition on iOS

This commit is contained in:
Ryan Heise 2020-08-01 14:59:22 +10:00
parent 2596da4a5b
commit 6d14d257a0
6 changed files with 46 additions and 0 deletions

View file

@ -63,4 +63,15 @@
return _playerItem.currentTime;
}
- (CMTime)bufferedPosition {
NSValue *last = _playerItem.loadedTimeRanges.lastObject;
if (last) {
CMTimeRange timeRange = [last CMTimeRangeValue];
return CMTimeAdd(timeRange.start, timeRange.duration);
} else {
return _playerItem.currentTime;
}
return kCMTimeInvalid;
}
@end