fix: Pause on iOS not working correctly
What
This PR fixes a gap while video on pause
Changes
This PR stores the difference between the last timestamp and the timestamp when the video was paused. Subsequently, the diff is taken to add new frames.
Tested on
iPhone 11, iOS 15.4
Related issues
#973
Additional
It works correctly in case of video, but I still have an issue with sound. Any help would be appreciated.
Phew, this looks pretty complicated. Wouldn't it be possible to just add a single new variable that keeps track of the latest recorded timestamp when pause was initiated? Maybe we can abstract this into a separate object to avoid having everything in the CameraView...
In the case of storing the last recorded timestamp, we may encounter the problem of multiple pauses in the same video. I dunno a simpler way when we use a timestamp to add in a buffer.
Any progress on this PR? Would be a huge help.
Hey thanks for your PR and sorry for the long radio silence here! I think this approach is a bit messy, I wonder why AVAssetWriter doesn't properly work with the timestamp difference when paused. Maybe we should use another master clock?