AVPlayer.timeControlStatus and AVPlayer.rate are wrong during fast forward or backward
When a user scrubs, seeks, fast forwards, rewinds, uses trackpad or touch gestures or key bindings that would result in the AVPlayer changing times we may set the rate to 0 during the operation, but in most cases we will restore the rate thereafter.
Outside of these (and a few other operations at the control of the AVPlayer owner), checking that the AVPlayer's rate is 0 or timeControlStatus == .paused should be sufficient for determining whether the video frame is not changing.
Who is "we"? Is it AVKit or I the developer who uses AVKit? If you really mean the latter, then why would we set the rate to 0? And how would we intercept all those operations, when AVPlayerView already does it?When a user scrubs, seeks, fast forwards, rewinds, uses trackpad or touch gestures or key bindings that would result in the AVPlayer changing times we may set the rate to 0 during the operation, but in most cases we will restore the rate thereafter.
As I said, timeControlStatus == .paused is true even when the user plays fast forward or backward (by pressing L twice or J after pressing the play button) and even if during this time the pause button is shown and not the play button. I would have expected that whenever the pause button is shown timeControlStatus != .paused and rate != 0. In the end I really just want to know if the play or pause button is shown, so that I can react to changes in other views and seek to another frame only if the play button is shown and the user is not expecting the video to keep playing.checking that the AVPlayer's rate is 0 or timeControlStatus == .paused should be sufficient for determining whether the video frame is not changing
(formatting in previous comment isn't taking, reposting here)
Who is "we"? Is it AVKit or I the developer who uses AVKit? If you really mean the latter, then why would we set the rate to 0? And how would we intercept all those operations, when AVPlayerView already does it?
We in this case is AVKit and AVFoundation, so the former. Anytime a users seeks, fast forwards/backwards/scans, uses trackpad gestures or key bindings that would result in the media changing times we will set the rate to 0 during the operation. There is no way to directly detect these operations as it stands.
As I said, timeControlStatus == .paused is true even when the user plays fast forward or backward (by pressing L twice or J after pressing the play button) and even if during this time the pause button is shown and not the play button. I would have expected that whenever the pause button is shown timeControlStatus != .paused and rate != 0. In the end I really just want to know if the play or pause button is shown, so that I can react to changes in other views and seek to another frame only if the play button is shown and the user is not expecting the video to keep playing.
The video is truely paused when the user fast forwards/scans backwards. When the user requests to fast forward (lets say at 10x - anything >2x), AVKit will pause the video and start periodically seeking very quickly to achieve the look of a higher playback rate - all while the rate is actually 0. (see my previous comments about the rate being 0 not necessarily meaning that the content in the video layer is not changing).
Unfortunately there is no great way to detect the exact state of the play button during scan/track pad gesture operations at the moment. I would file a feedback request synthesizing the issue here and we will consider adjusting this behavior.
Team,We are in need to differentiate manual pause and pause state caused due to seek(scrubbing uislider in avplayerviewcontroller). We need to send engagement apis on state changes for pause,seek,play. Is there any way to solve this problem. @Media Engineer @Nickkk