Home HelloWorld! Doc API Examples GitHub
Example Timing Object (multi-device)
Timing Objects may become online timing objects if they are connected to an online timing provider. This way, turning a single-device demo into a multi-device demo is almost trivial.
Demo Tips
- open this page on multiple devices (or at least multiple browser tabs) (simultaneously) to verify multi-device timing.
- the timing provider is shared globally, so others might be playing with demo too…
- try reloading the demo on one device/tab while the demo is running on others.
Demo
JavaScript
This is the essential JavaScript of the original Timing Object Example.
var run = function () {
// timing object
var to = new TIMINGSRC.TimingObject({range:[0,100]});
...
};
Turn this into a multi-device demo by plugging an online timing provider into the timing object.
var run = function (timingProvider) {
// timing object
var to = new TIMINGSRC.TimingObject({provider:timingProvider});
...
};