Subtitles on HTML 5 YouTube videos - done already?

Discussion in 'Web Design and Development' started by Albright, Aug 23, 2011.

  1. Albright macrumors regular

    Aug 23, 2011
    Currently, YouTube supports subtitles on videos only when they're played using their Flash player. That means that you can't see them on iOS devices, either viewing them embedded in a web page or using the YouTube app.

    But looking behind the scenes, it looks like YouTube does subtitles by transferring a separate XML with text and timecodes to the Flash video player. Thus, I figure it should be possible to hack together a page and script which displays the video with HTML 5 using the standard YouTube API, but also nabs that subtitle file off the server behind the scenes and parses it, then overlays the text over the video as it plays, thus making subtitled videos on iOS devices (and PCs where installing Flash is not possible/desired) possible.

    I think it would be a fun weekend project, but before I get started, I want to know if anyone out there has heard of someone out there already working on this, to avoid duplication of effort.
  2. lucidmedia macrumors 6502a

    Oct 13, 2008
    Wellington, New Zealand
    I would look closely at Popcorn.js and Butter. They are currently using XML as you have defined, but are moving over to JSON I hear...
  3. Albright thread starter macrumors regular

    Aug 23, 2011
    Hmm, interesting. I had never heard of that before. I don't think I'd use it, though, seeing as how iOS (or at least my iPad 1) tends to get dog slow on sites with large JavaScript libraries and such. And I only need it to do one specific thing; show subtitles on videos from YouTube in Mobile Safari. So I'd try to do it all in one self-contained script. It'll be a bit strange, seeing as how I haven't written a web script JavaScript without jQuery in years… But I'm sure it can be done.

    I'll keep that in mind for future projects, though.

Share This Page