Skip to content

Universalsubtitles

willkg edited this page Sep 21, 2011 · 2 revisions

Universal Subtitles

This page covers using Universal Subtitles in Python Miro Community. At present, we're tentatively adding support and not going whole-hog.

Why this is a pain in the ass

  1. Universal Subtitles has a javascript thingy that will detect video on the page and automatically wrap it. This doesn't work for blip.tv videos (but may in the future). So we can't use it.

  2. Miro Community has no API allowing us to programmatically do anything--everything needs to be done through the web interface.

  3. In order to wrap an individual video with Universal Subtitles, we have to figure out the Universal Subtitles wrapping code and put it in the embed field. It looks something like this:

    <script type="text/javascript" src="http://s3.www.universalsubtitles.org/embed.js>
        ({
            video_url: "http://blip.tv/file/get/Pycon-PyCon2011FridayAfternoonLightningTalks769.ogv"
        })
    </script>
    
  4. Best way to do this is with HTML5 video. For the last year, over 80% of the users are using Firefox and Chrome. So we're going to use Ogg Theora for the video format. That does present a problem for people not using these browsers, but I can't figure out a solution that works for everyone given the heavy restraints I have.

Resources

How we do it

  1. Will wrote a CGI script that pulls the blip.tv feed and "converts" it to something that Miro Community is happier with, puts the data in the right places, and automatically creates the Universal Subtitles embed code.
  2. This script is added as a source in Miro Community.

Complexities

  1. Blip.tv's RSS feed maxes out at 100. If there are more than 100 videos in the feed from a single conference, then it only shows the latest 100. Thus, if PMC has bad timing, we have to add videos by hand. Srsly.
  2. If Universal Subtitles ever changes the embed code, we have to fix every video on PMC that uses it by hand. This can only be done in the Bulk Edit screen and by hand. We really need to implement an API for MC so that we can do this programmatically.

To do

FIXME - These need to get converted to Issues in the tracker.

  1. The script should be fixed to be more general (i.e. take any blip.tv feed rather than have the feed hard-coded).
  2. The script should be re-written so that it has two parts:
    1. runs as a semi-frequent cronjob slurping blip.tv videos so we don't miss any
    2. gets executed as a CGI from MC when it does its nightly source updates returning the videos it found
  3. The code should get checked into github so it's in version control.
Clone this wiki locally