Can Popcorn.js be used to add subtitles to a YouTube video?

1.4k Views Asked by At

Let's say we embed a YouTube video on a web page.

Underneath the video player, could we display subtitles synched to the video using a media framework like Popcorn.js?

3

There are 3 best solutions below

0
Cat Chen On BEST ANSWER

If you choose the HTML5 version when embedding the YouTube video and if it's actually being played within an HTML5 browser, it's just a video tag so you can use Popcorn.js. When it's a Flash, I'm not sure if you can get into that Flash and know the progress and listen to the events.

0
AKX On

If you use the YouTube JavaScript Player API, you can use player.getCurrentTime() to find out which line of subtitling to show.

Then again, YouTube already supports subtitles to begin with.

0
Scott Downe On

Interesting you mentioned Popcorn.js, because Popcorn does support Youtube.

http://popcornjs.org/popcorn-with-youtube

Buuut, that documentation is out of date.

It is now:

"var example = Popcorn.youtube("

There are new docs on their way.