如何讓AVPlayer對象反向播放其視頻內容? AVPlayerItem類有一個名爲「reversePlaybackEndTime」的屬性,這使我認爲反向播放是可能的,但我似乎無法在文檔中找到關於實際執行操作的任何內容。AVPlayer Reverse Playback
5
A
回答
2
當您向AVPlayer對象發送「播放」消息時,它開始播放,這相當於將rate屬性設置爲1.0。您是否嘗試將該屬性設置爲-1.0?我目前還沒有Mac來測試它,所以如果這不起作用,我會刪除我的答案。
5
您可以reverse play
這樣的queuePlayer
是AVPlayer
:
首先得到end
的video
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");
現在設置的AVPlayer
Rate
到negative
值
[self.queuePlayer setRate:-1];
相關問題
- 1. Widevine Video Playback
- 2. ChanSpy + PlayBack + MutingChannel星號
- 3. __NSCFString playback MPMoviePlayerControllerFigureished unrecognized selector
- 4. 通知Haskell'(Reverse(Reverse xs))〜xs`
- 5. AVPlayerViewController只使用AVPlayer音頻AVPlayer
- 6. WCF REST Streaming for video playback
- 7. Reverse slideToggle
- 8. Reverse MemoryStream.ToArray()
- 9. Reverse requirements.txt
- 10. Reverse animateWithDuration
- 11. startAnimatingWithImagesInRange reverse
- 12. Reverse Streamreader
- 13. geocode reverse
- 14. reverse htmlspecialchars
- 15. Reverse factorial
- 16. reverse C++ array
- 17. NSoperation reverse dependencies
- 18. ModelMultipleChoiceField和reverse()
- 19. php reverse imagecreatefromstring
- 20. Android Reverse Geocode
- 21. Switch Statement Reverse
- 22. Django HttpResponseRedirect和reverse()
- 23. mysql substring_index reverse
- 24. Postgres「reverse count(*)」(unnest?)
- 25. 「Reverse GROUP_CONCAT」in MySQL?
- 26. Reverse Ajax + JSP-Servlet
- 27. Reverse Ajax + Spring MVC
- 28. angularslideables reverse effect
- 29. reverse colortransform alpha AS3
- 30. reverse serialize()-jquery
這個工作,雖然播放有點波濤洶涌。 – 2011-05-23 09:50:10
@Rhythmic Fistman不適合我? – 2013-04-19 10:50:47
根據蘋果的文檔率可以介於0.0和1.0之間。 -1.0不是有效值。 https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayer_Class/index.html#//apple_ref/occ/instp/AVPlayer/rate – xyclos 2016-01-25 16:23:29