Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Adding functionality in order to pull captions from Universal Subtitles... #29

Open
wants to merge 69 commits into
base: master
Choose a base branch
from

Conversation

anvk
Copy link

@anvk anvk commented Mar 22, 2012

...using cross domain asynchronous calls by retrieving JSONP and then converting it to the supported WebVTT format.
This feature keeps video captions up-to-date using captionator with your video plus it does not require having caption files on the server.

Usage:
As example a caption track could be provided with src="http://www.universalsubtitles.org/api/1.0/subtitles/?video_url=http://www.youtube.com/watch?v=kmk43_2dtn0&language=en" or src="http://www.universalsubtitles.org/api/1.0/subtitles/?video_url=http://www.youtube.com/watch?v=kmk43_2dtn0&language=fr" or any other language and type="jsonp/webvtt".

cgiffard and others added 30 commits March 2, 2011 23:56
…k to the video when the page resizes, among other things.
Moved the generateTranscript function out of the library, because it's a
user function and not part of the standard.

Renamed the constants in the TextTrack class so they can be used outside
of the class.

Added another html page to experiment with the IDL of TextTrack.

Added @default and @id attributes to the <track> element.
…r now supports SRT, SUB, SBV, and WebVTT parsing.
cgiffard and others added 28 commits August 10, 2011 11:20
…es using cross domain asynchronous calls by retrieving JSONP and then converting it to the supported WebVTT format.

This feature keeps video captions up-to-date using captionator with your video plus it does not require having caption files on the server.

Usage:
As example a caption track could be provided with src="http://www.universalsubtitles.org/api/1.0/subtitles/?video_url=http://www.youtube.com/watch?v=kmk43_2dtn0&language=en" or src="http://www.universalsubtitles.org/api/1.0/subtitles/?video_url=http://www.youtube.com/watch?v=kmk43_2dtn0&language=fr" or any other language and type="jsonp/webvtt".
@cgiffard
Copy link
Owner

Sorry it's taken me so long to get to this!

I really like the idea of specifying a JSONP resource via src.

That said, I've always tried to make Captionator as standards-y as I can, so I might have to massage this a bit in order to make it fit. I'm having a look at how it'll fit into 0.6 too, since I've re-architected it a bit.

// Generate a random callback function name
var callbackName = "json"+(Math.random()*100).toString().replace(/\./g,"");
// Attach the function to the global namespace
window[callbackName]= function(data){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether it'd be possible to namespace this into the captionator object somehow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants