How to sync media playback across two devices?

I am using the following method of AVPlayer.h class in my project.

- (void)setRate:(float)rate time:(CMTime)itemTime atHostTime:(CMTime)hostClockTime

      

According to AVPlayer.h documentation, this method can be used to synchronize playback on two devices, assuming the host time is one device.

I gave all the "time" options I could give as parameters to itemTime and hostClockTime, but the playback was never synchronized. In fact, AVPlayer does not play media elements.

Any help would be much appreciated by individuals who have used this method for syncing, as well as any other mechanism for syncing media playback on iOS devices.

Thanks in advance.

+3


source to share





All Articles