2

Im playing a video from youtube on my site and want to be able to use these captions at my domain. JW player documentation about captions can be found here:

Now here's the problem: JW player's built in translation support looks like this:

tracks: [{ 
            file: "/assets/captions-en.vtt", 
            label: "English",
            kind: "captions",
            "default": true 
        },{ 
            file: "/assets/captions-fr.vtt", 
            kind: "captions",
            label: "French"
        }]

It uses a physical path to search for .vtt files.

My question is simply:
How do i fetch captions from a youtube video and display them in JW player?

dont_trust_me
  • 540
  • 8
  • 24
  • That is not possible I'm afraid. We don't support that through their API. – emaxsaun Jun 02 '15 at 15:16
  • If you own the video, you can set up your own script (outside of JWPlayer) that can download them dynamically and return them as a URL that JWPlayer can use; however, if you don't own the video, the YouTube captions are not available via the API. – jlmcdonald Jun 02 '15 at 17:07
  • I solved the fetching part from youtube, so now it looks like this file: http://video.google.com/timedtext?lang=sv&v=jFRj5uH3Jhc&fmt=vtt When opened in browser, the .vtt file displays correclty but no captions show up in JW player. – dont_trust_me Jun 02 '15 at 18:20

1 Answers1

0

You can use captions feature in API v3 to retrieve video captions.

Ibrahim Ulukaya
  • 12,767
  • 1
  • 33
  • 36
  • I solved the fetching part from youtube, so now it looks like this file: http://video.google.com/timedtext?lang=sv&v=jFRj5uH3Jhc&fmt=vtt When opened in browser, the .vtt file displays correctly but no captions show up in JW player. When i try using jwplayer's example from their documentation, http://bob.jwplayer.com/~randy/caption.vtt, it works. Am I handling the .vtt file from youtube wrong or what? – dont_trust_me Jun 04 '15 at 08:07