I used seekToTime in my application and it works correctly. But I want more information about this. If I have a streaming video file with 1 minute, I want to play it from the second 15th to the second 45 (the first 15 seconds and the last 15 seconds will not play).
How can i do this?
I know that with seekToTime I can play a video from the 15th second, but how can I stop it at the 45th second, and also notice that the method played the video for a specified period of time?
CMTime timer = CMTimeMake(15, 1);
[player seekToTime:timer];
The above code brings me back to the 15th second of the stream file, but how to stop it at the 45th second and receive a notification?
I searched a lot, but could not get the information.
thank
EDIT:
As suggested by @codeghost, just use forwardPlaybackEndTime.
:
yourAVPlayerItem.forwardPlaybackEndTime = CMTimeMake(10, 1);
10 - , AVPlayerItem .