0

I checked the documentation of YouTube Player API Reference, but it does not specify any parameters to add a path to our own VTT file for captions.

I also came across Plyr.JS, but I am not sure if it can be used to achieve the same.

So, is there any way to play our own subtitle on YouTube videos?

Gokul NC
  • 1,111
  • 4
  • 17
  • 39

1 Answers1

1

I found an indirect temporary way to do it.

  1. Call this endpoint to get the direct link for the YouTube video:
    https://maadhav-ytdl.herokuapp.com/video_info.php?url=https://www.youtube.com/watch?v=BaW_jenozKc

(Source code for this server: https://github.com/Maadhav/youtube-downloader-API )

  1. decodeURIComponent() the link that you get.
  2. Then embed the video link and your captions track in tag as described here.

Works as on December 2020.

Gokul NC
  • 1,111
  • 4
  • 17
  • 39
  • Another endpoint if above does not work: https://www.yt2mp3.ws/developers ([Source code](https://github.com/matthew-asuncion/Fast-YouTube-to-MP3-Converter-API)) – Gokul NC Feb 12 '22 at 13:33