Play AVPlayer

How could you make an AVPlayer object play its video content in reverse order? The AVPlayerItem class has the "reversePlaybackEndTime" property, which makes me think that reverse playback is possible, but I can not find anything in the documents about its actual execution.

+5
source share
2 answers

You can reverse playdo this as queuePlayeris AVPlayer:

First go to endofvideo

CMTime durTime = self.queuePlayer.currentItem.asset.duration;
durationTime = CMTimeGetSeconds(durTime);
//NSLog(@"durationTime :%f : %f",durTime);
if (CMTIME_IS_VALID(durTime))
    [self.queuePlayer seekToTime:durTime toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
else
    NSLog(@"In valid time");

Now set the Ratevalues AVPlayeron the negativevalue

[self.queuePlayer setRate:-1];
+5
source

"" AVPlayer, , 1.0. -1.0? Mac, , , , .

+2

All Articles