Search code examples
htmlvideokalturacaptions

Allowing Captions in Videos - HTML


My site uses links to videos that use the Kaltura video player. On the Kaltura side, the videos' captions appear. However, on the HTML side, when the site is ran, the captions do not appear. Is there a tag or something that I can add to these video links in HTML to allow captions to appear?


Solution

  • <video width="360" height="203" id="captionvideo" controls="controls">
        <source src="myvideo.mp4" type="video/mp4">
        <source src="myvideo.webm" type="video/webm">   
        <track kind="subtitles" src="mymovidecatpion.srt" srclang="en" ></track>
    </video>
    

    and your .srt file...

    0
    00:00:00,1 --> 00:00:04
    Caption line goes here
    
    1
    00:00:04 --> 00:00:07
    Browser shall obey me!  HAHAHAHA
    
    2
    00:00:07 --> 00:00:10
    Of course, we are so important because we help people understand TV in words.
    
    3
    00:00:10 --> 00:00:12
    and is very educational for everybody anyways...
    

    and goes on....