6/19/2023 0 Comments Custom subtitles youtubeMake sure to update the 'src' attribute with the path to your subtitle file. And at last 'default' attribute has been added to the track, which will make sure that this subtitle is selected by default if we use multiple text tracks. ![]() The source language (srclang) for the track is English (en) and the label for this subtitle or audio track will be 'English'. Then, we've added the path to the video in the tag.īelow that, tag with 'kind' as 'subtitles' has been used to import the subtitle file. In the above code snippet, we've created a element using the class. Use the following code for adding a text track to the video player − This tag is also going to be children of the element just like the tag. Once you have a subtitle file ready for your video, you can add it to the video player.įor adding a time-triggered text track to the video.js player, we're going to use the tag. ![]() Generally, these files have text lines with a specific start time and end time. Note For creating a timed text track or subtitle file, you need a text file in the webVTT format. Subtitles, also known as Text tracks, is an HTML5 feature that allows users to view time-triggered text. How to Add Subtitles in Video Using Video.js? Let's learn how to add subtitles to our video using video.js in the next section of the video. Adding subtitles to the video really enhances the video experience for the viewers who are deaf or hard-of-hearing.Īdding subtitles using video.js is very easy and furthermore, video.js allows crossbrowser implementation of the subtitle. Subtitles, often known as captions, are lines of speech or other text that appear at the bottom of the video. In this tutorial, we're going to learn how to add subtitles to a video using the video.js library.
0 Comments
Leave a Reply. |