I am using in the end an observer, which takes snapshots of the currentTime
each 5 seconds, and calls all the other AVPLayer
with the seekToTime
method. This works fine to keep them synchronized. I just needed to adapt the CMTime
for each player with different speed. As an example I got here 4x video:
videoPosition = player1.currentTime; //gets the video duration
videoPositionInSeconds = (Float64) videoPosition.value/videoPosition.timescale; //transfers the CMTime duration into seconds
[player2 seekToTime: CMTimeMakeWithSeconds(videoPositionInSeconds/4.0, player1.currentItem.asset.duration.timescale) toleranceBefore: kCMTimeZero toleranceAfter: kCMTimeZero];
Hope this helps.