Home Doc API Examples GitHub

Example MediaSync (page-local)

Synchronization and control of two video elements using timing object. Both videos produce audio independently. Listening to the audio is likely the best way to detect synchronization errors.

Demo

Player 1

Player 2

JavaScript

// timing object
var to = new TIMINGSRC.TimingObject({range:[0,100]});

// set up video sync
var sync1 = new TIMINGSRC.MediaSync(document.getElementById('player1'), to);

// set up video sync
var sync2 = new TIMINGSRC.MediaSync(document.getElementById('player2'), to);