W3C home > Mailing lists > Public > public-webtiming@w3.org > June 2015

Rough prototype implementation of the TimingObject specification

From: Francois Daoust <fd@w3.org>
Date: Mon, 08 Jun 2015 15:00:17 +0200
Message-ID: <557591E1.10605@w3.org>
To: public-webtiming@w3.org
Hi Multi-Device Timing CG participants,

To explore the interfaces defined in the draft TimingObject 
specification [1], I have started to implement an open-source prototype 
in JavaScript. I wanted to toy with a simple mechanism to associate a 
local timing object to an online timing service in particular. While 
work is not over, the foundations are there, so I thought I would 
already share the code:

  https://github.com/tidoust/timingservice

The code implements the "TimingObject" and "StateVector" (formerly known 
as MediaStateVector) interfaces that the spec defines. It also explores 
the possibility to associate a local instance to an online timing 
service through an "srcObject" attribute and a "TimingProvider" class.

The TimingProvider object implemented here uses a simple JSON-based 
messaging protocol on top of a Web Socket.

The "srcObject" idea is inspired by the srcObject attribute of 
MediaElement in HTML [2]. It would allow third-party timing services to 
provide their own implementation of a TimingProvider object in 
JavaScript (unless they need to use specific protocols that would 
require native support), which seems to match the need to give online 
services some room to innovate that was expressed on the mailing-list.

Please check the description on GitHub for useful information and 
restrictions, noting that:
- the code only runs under Node.js right now, although I should manage 
to get the client side to run in Web browsers pretty soon;
- the clock synchronization mechanism is so rough that it cannot really 
be called synchronization: the code merely computes the skew once in a 
while;
- some parts are not implemented, notably range restrictions;
- there are no good examples so far, only a useless command-line example 
that does not really do anything. I do not have code that shows how to 
bind a timing object with a media element yet, for instance.

That said, writing this simple code already triggered a few questions on 
the spec, which I'll raise in separate threads.

I'll keep the group updated as I make progress on this experiment. Feel 
free to give it a try in the meantime! :)

Thanks,
Francois.

[1] http://webtiming.github.io/timingobject/
[2] 
http://www.w3.org/TR/2015/WD-html51-20150417/semantics.html#media-element
Received on Monday, 8 June 2015 13:00:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:25:14 UTC