timing-object icon indicating copy to clipboard operation
timing-object copied to clipboard

Plans to include TimingTextTrack

Open chadacious opened this issue 5 years ago • 3 comments

I'm interested in using the TimingObject with a video element source to use for metadataTracks. Is this project including plans for implementing the TimingTextTrack from the spec as well?

chadacious avatar Jun 06 '19 16:06 chadacious

Hi @chadacious,

thanks for your interest in this project. Currently the TimingTextTrack is not part of this project but I'm definitely interested in adding it. So far only the TimingObject itself is implemented and none of the other objects which expose a timingSrc property.

Can you maybe elaborate a bit more on your use case.

chrisguttandin avatar Jun 06 '19 16:06 chrisguttandin

I've been using the video element's addTextTrack for managing subtitle and metadata cues, but I'm finding that their events are not firing at the level of accuracy I am looking for. Frame accuracy would be great, but if I could at least get 8ms or less that should be good for my purposes. As an example, in chrome my results show that most often the onenter and onexit events are firing right on time (e.g. 0.8ms), but then at random times it can be delayed by as much as 250ms which isn't acceptable for my requirements. I'm looking at a number of options but was intriqued by the timingsrc project and your efforts as well so thought I would give it a look through.

chadacious avatar Jun 06 '19 19:06 chadacious

There could, of course, be a bug somewhere in Chrome's implementation of the video element but in general events fired on the main thread do not have a reputation of being very accurate. Whenever there is something which keeps the JavaScript engine busy there is no chance to fire an event. There is no way to avoid that. I'm therefore not really sure if the TimingTextTrack would help you, if that's the problem you have.

But again, as already said this could, of course, also be something in Chrome's implementation which prevents the events from being triggered timely. I just don't know it.

May I ask what you are trying to trigger with such an accuracy? To accurately trigger sounds the Web Audio API does for example allow to schedule things upfront. The actual timing is then handled in another thread and is therefore immune to potential performance bottlenecks on the main thread. Maybe a similar approach would work for you as well.

chrisguttandin avatar Jun 06 '19 21:06 chrisguttandin