Home HelloWorld! 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.


Player 1

Player 2


<script text="javascript" src="https://mcorp.no/lib/mediasync.js"></script>


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

// set up video sync
var sync1 = MCorp.mediaSync(document.getElementById('player1'), to);

// set up video sync
var sync2 = MCorp.mediaSync(document.getElementById('player2'), to);