Closed akash-mastercreationz closed 7 years ago
@akash-mastercreationz you will need to save the time of the video (if you're using AVPlayer
you can use the -currentTime
method. Once you've saved this data somewhere, maybe in an NSMutableDictionary
when the user plays the video, (again assuming that you're using AVPlayer
use the -seekToTime:
instance method.) Note, that you can only all this method if theAVPlayer
status is equal to AVPlayerItemStatusReadyToPlay
Also, technically this issue is outside of the scope of this library. 😉
@akash-mastercreationz here is a code snippet on how to use the seeking.
switch (self.playerView.player.currentItem.status) {
case AVPlayerItemStatusReadyToPlay:
[self.playerView.player seekToTime:CMTimeMake(50, 1.0) completionHandler:^(BOOL finished) {
[self.playerView.player play];
}];
}
@akash-mastercreationz you will probably want to use KVO and observe the changes of the AVPlayerItem
's status.
Closing this as a duplicate of #327.
Is there any way to save the songs played and whenever user play the same song, the song will start from the time it was stopped. Like in youtube .