Add video with srt-file - Forum | JoomShaper
Staff replied SP Page Builder

Add video with srt-file

Asked by Alexander Schuch 2 years ago Last activity 2 years ago

Hi,
using J5 and latest SPPB5.
I would like to build up a video tutorial section. Videos shall be supported with sub-titles. So I have uploaded a video on a test page, also added the srt-file for sub-titles to the folder.

How can I automatically show the subtitles from srt-file, or let the user decide, if the subtitles shall be shown, or not. Any solution for that in SPPB?

Thank you.

3 replies

Paul Frankowski Senior Staff

Hi Alexander,

Sorry, not yet, but make research maybe there is ready HTML5 code for that you can use inside Raw Html addon.

yes, later you can share here.

Alexander Schuch Asked this
2 years ago · edited

Hi Frank, I did some research and came up with following responsive solution, which fits my needs, but should be usable for all:

<video controls width=100% height=auto>

    <!-- Video source -->
    <source type="video/mp4" src="/videos/examplevideo.mp4">

    <!-- Subtitles -->
    <track src="/videos/examplevideo_DE.vtt" label="Deutsch" kind="subtitles" srclang="de" default>
    <track src="/videos/examplevideo_EN.vtt" label="English" kind="subtitles" srclang="en" >

    <!-- Fallback content -->
    Your browser does not support HTML5 video. Here is a <a href="/videos/examplevideo.mp4">link to the video</a> instead.

</video>

Hope that also helps other users!

Paul Frankowski Senior Staff
2 years ago · edited

Yes, good to know, but to be honest you're first person with that request.

I think we can implement that in Video addon one day, useful also for Accessibility purposes.

BIG THANKS / DANKE :)

Log in to reply.