Yay for Jacob Seidelin to join me in accessihacking YouTube
Jacob Seidelin took his JavaScript kung-foo skills off Super Mario for a short while and wrote a proof of concept how to get the annotations out of a YouTube video to display it outside the movie.
I’ve blogged about this idea here and his solution is an example to use timeout to poll for annotations being displayed.
One little change with a massive impact would be to display the annotations in a form field - thus automatically updating screen reader buffers that there was a change.
This has the same issues as my idea to display timed comments as subtitles below the movie - polling is just not safe (imagine buffering in between), so it seems a simple method in the YouTube player to fire events at certain times would be great. Something like this:
var events = {
times:[12312,12312314,14234234,234234234,23423425],
callback:onTimedEvent,
obj:{something:3}
}
ytplayer.timedEvents(events);
function onTimedEvent(o){
// o would be {time:12312,obj:{something:3}};
}
The object would be a nice to have, for example to keep scope.
Check out Jacob’s annotation scraping example here
Tags: accessibility, annotations, player, youtube


June 6th, 2008 at 2:08 pm
As long as you get the current time from the ytplayer itself, what’s the problem with polling? (other than it being a bit ugly..) If the video pauses for whatever reason, so does the time reported by ytplayer.getCurrentTime(), no?
June 6th, 2008 at 3:57 pm
Well, as you say it is ugly, and a hack. There is also quite a memory and processing overhead in intercepting the player constantly and calling the getCurrentTime() method. Of course it is a good solution for now, but I’d rather see this in the player API itself, natively than having that extra overhead.
June 6th, 2008 at 5:12 pm
Of course, I agree. And I imagine it’s just a matter of time before there’s a real API available.