Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个应用程序,我想同时播放两个视频,这是不可能的MPMoviePlayer。所以我习惯AVQueuePlayer了播放视频。由于我成功播放视频,但问题在于跳到特定时间。为此,我们有方法调用seekToTime,我们需要CMTime datatype.
MPMoviePlayer
AVQueuePlayer
seekToTime
CMTime datatype
我能够在 1、2、3 秒等时间跳转,我的问题是我想在 1.2、1.3、1.4 秒等时间跳转,但当时我无法移动视频。
谁能知道这个问题的解决方案,而不是请帮我解决这个问题。
但是, seekToTime: 方法是针对性能而不是精度进行调整的。如果您需要精确移动播放头,请使用 seekToTime:toleranceBefore:toleranceAfter参考
toleranceBefore:您希望将播放光标移动到之前的时间精度。 [前时间容差]
toleranceAfter:您希望将播放光标移动到的时间精度。 [时间+后容差]
假设这两个参数都代表了准确度的边际。
我已经看到其他关于 SO的问题self.player.currentItem.asset.duration用于获取持续时间。
self.player.currentItem.asset.duration
祝你好运。