This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Synchronising audio/video and JavaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Synchronising audio/video and JavaScript" Watch "Synchronising audio/video and JavaScript" New topic
Author

Synchronising audio/video and JavaScript

Keith Wood
Author
Ranch Hand

Joined: Aug 28, 2012
Posts: 38

Hi Rob

In HTML5 is it possible to synchronise audio or video with JavaScript actions? I have a page that drives a SVG animation from JavaScript that I want to synch with some music. But currently all I can do is start them at the same time and hope for the best.


Author of the upcoming "Extending jQuery" book from Manning.
Rob Crowther
author
Ranch Hand

Joined: Nov 06, 2012
Posts: 295
    
    5

The solution for this will be Timed Tracks, though that's not yet fully supported by browsers. Here's a more readable introduction. It allows you to have a file containing a list of timed cues which then fire events in the browser which you can use to trigger other actions on the page.


Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
Keith Wood
Author
Ranch Hand

Joined: Aug 28, 2012
Posts: 38

Thanks, that looks useful. It's a pity it isn't more widely supported yet.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Synchronising audio/video and JavaScript
 
Similar Threads
two questions about RSS
Enabling and Disabling Audio/Video in Browser window
.ra to .mp3 convertor
NullPointerException
avTransmit and avReceive problem