Open vorg opened 9 years ago
The thing about AVPlayer is that it is a playlist. So duration could mean the duration of the entire playlist, just the current item, etc. Maybe currentDuration, and there could also be a totalDuration?
Renaming it to currentDuration in order to match currentTime sounds good. Don't need totalDuration. More useful would be currentTract / totalNumTracks.
It's possible that currentItem is nil, see currentLoadedTimeRanges to how to handle that, you should return NULL.
TextureAVPlayer* player = ExtractPlayerPointer(args.This());
AVPlayerItem* item = [player currentItem];
if (item == nil)
return args.GetReturnValue().SetNull();
Added duration getter for AVPlayer e.g.: