Synchronization of several player components
Several player components can be synchronized. One component is declared as the master component; the other components are the slave components.
Example:
VideoGrabber2.Synchronized = true
VideoGrabber2.SynchronizationRole = sr_Slave
VideoGrabber3.Synchronized = true
VideoGrabber3.SynchronizationRole = sr_Slave
VideoGrabber1.Synchronized = true
VideoGrabber1.SynchronizationRole = sr_Master
VideoGrabber1.PlayerFileName = "myclip.avi"
VideoGrabber1.AutoStartPlayer = false
VideoGrabber1.OpenPlayer()
VideoGrabber1.StartSynchronized ()
This opens the clip in the 3 components at the same time. From then on, all the player actions below performed on VideoGrabber1 are applied at the same time to VideoGrabber2 and VideoGrabber3:
- invoking the following functions:
- assigning the following properties:
Shifting the synchronization position of one slave player
To set a delta position on a slave player (after the clip is opened on all the components), proceed as follows:
- Temporarily disable the Synchronized property on this slave.
- Set a new position on the slave (with PlayerFramePosition or PlayerTimePosition).
- Enable the Synchronized property on this slave again.
All the position changes on the master component are then performed on the slave by applying the delta position set while the Synchronized property was disabled.
See the SynchronizedPlayers demo project included in the package for sample code.