Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display subtitles from SRT file #5

Open
Tracked by #188
jo-elimu opened this issue Nov 5, 2024 · 5 comments
Open
Tracked by #188

Display subtitles from SRT file #5

jo-elimu opened this issue Nov 5, 2024 · 5 comments
Assignees
Labels
ux/ui User Experience (UX) / User Interface (UI)

Comments

@jo-elimu
Copy link
Member

jo-elimu commented Nov 5, 2024

Description

If the video comes with subtitles attached, extract the words from the SRT file and display at the bottom of the video.

Sample format:

1
00:00:00,080 --> 00:00:01,680
Akiri Akiri

2
00:00:01,680 --> 00:00:03,520
Akiri

3
00:00:05,640 --> 00:00:08,560
This is number one The special number

4
00:00:08,560 --> 00:00:11,520
one Her shape is like a stick Say

5
00:00:11,600 --> 00:00:14,400
one everyone One, one,

6
00:00:14,400 --> 00:00:16,600
one, one There is one sound

Why?

This feature is needed because subtitles improve learning outcome.


@jo-elimu jo-elimu added the ux/ui User Experience (UX) / User Interface (UI) label Nov 5, 2024
@tuancoltech
Copy link
Member

@jo-elimu Can you modify the web app to allow uploading SRT for a video?
http://tgl.elimu.ai/content/multimedia/video/create

@tuancoltech tuancoltech self-assigned this Mar 12, 2025
@jo-elimu
Copy link
Member Author

jo-elimu commented Mar 13, 2025

@tuancoltech Yes. First, do you know what data format you will be needing implementing subtitles in the Android app? Just a regular .srt text file, or some other format? And perhaps the default Android media player supports the display of subtitles already?

@tuancoltech
Copy link
Member

tuancoltech commented Mar 13, 2025

@tuancoltech Yes. First, do you know what data format you will be needing implementing subtitles in the Android app? Just a regular .srt text file, or some other format? And perhaps the default Android media player supports the display of subtitles already?

@jo-elimu We're using ExoPlayer in Android Filamu app. And it does support playing video along with subtitles.
Please refer to the supported subtitle formats here: https://developer.android.com/media/media3/exoplayer/supported-formats#standalone-subtitle (.srt is one of the supported formats, yes)

@jo-elimu
Copy link
Member Author

@tuancoltech Thank you. Yes, looks like this is the exact code we need: https://developer.android.com/media/media3/exoplayer/media-items#sideloading-subtitle-tracks

So then I guess we can just refer to an .srt file stored somewhere on the filesystem.

Added an issue for implementing this in the backend: elimu-ai/webapp#2061

@tuancoltech
Copy link
Member

tuancoltech commented Mar 13, 2025

@tuancoltech Thank you. Yes, looks like this is the exact code we need: https://developer.android.com/media/media3/exoplayer/media-items#sideloading-subtitle-tracks

So then I guess we can just refer to an .srt file stored somewhere on the filesystem.

Added an issue for implementing this in the backend: elimu-ai/webapp#2061

@jo-elimu Yes.
Further on this: When we have .srt files provided from backend, we can implement a separate provider for subtitles in content-provider, and links to it via a subtitleId column in Video table.
Then, before playing video we need to load both video data stream and subtitle stream from physical files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux/ui User Experience (UX) / User Interface (UI)
Projects
None yet
Development

No branches or pull requests

2 participants