Movement by a single frame in CMTime and AVFoundation

后端 未结 2 993
花落未央
花落未央 2021-02-09 19:38

I\'m attempting to play a video with AVFoundation. I am using the following code for a button that advances the playback by one frame.

It works intermittently, on some e

2条回答
  •  心在旅途
    2021-02-09 20:39

    It isn't very obvious (since strangely it's only available in AVPlayerItem rather than AVPlayer) but if the AVPlayerItem returns YES for canStepForward/canStepBackward then you can call stepByCount:(NSInteger)stepCount: to move forwards or backwards by a certain number of frames.

提交回复
热议问题