Implement bufferedPosition on iOS
This commit is contained in:
parent
2596da4a5b
commit
6d14d257a0
6 changed files with 46 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue