-
Notifications
You must be signed in to change notification settings - Fork 405
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
[Proposal] Add Subtitle Support to Media Element #1899
Comments
All the work for this features current API is done. I have been refactoring code. I need to update the docs and get them approved. In about another week I will mark it as ready for review. I need to do device testing to see if there are any show stopper bugs or things that emulators missed. |
How's this looking? Feel like this could be a really great addition. |
Any updates on availability? Currently investigating the use of bunny.net as a media provider and restricted to using their viewer hosted in an iFrame inside a WebView control (which brings its own problems), but they do have support for VVT and SRT format subtitle files. Would ideally want to test this within the MediaElement. |
I believe @ne0rrmatrix was really close with this. We have piled a lot of effort into .NET 9.0 support which we hope to merge in the next week or so and then we can start to revisit open PRs like the one for this proposal 👍 |
The last unresolved issue was solved months ago. I will update that this morning to reflect that I fixed the font issue. The one thing I have done that will require input is a complete rewrite that implements all this by using built in classes and we need to decide whether we go with custom implementation for subtitles or use native methods. Using native libs removes the need to support it but with custom libs we can do anything we want like allow third party support for custom subtitle support. An example is you can insert your own implementation for parser with this version but native libs don't allow this. |
You mean Subtitle support is finally ready and is going to merge in main ? |
You will be able to add a custom parser and support any text based subtitles that media element does not itself natively support. ATM I have added support for srt and vtt files. Or if you find a need for say supporting html and do not want to use my text only srt or vtt you will be able to just your own implementation and integrate that with media element directly yourself. It has great versitility. The choice will be yours. Or we can go with native libs(I have both versions ready) which will have better UI support with native buttons on windows and android plus support mulitple languages in both but not in IOS or mac os. Both versions do support both vtt and srt in a single file. The key differences are the native version supports a UI button and both versions let you select a variety of subtitle files that can be added as a simple list of URL's for both windows and android. This is not supported on apple devices natively. On the other hand you can write your own parser to fix any issues mine has plus you can add additional supported file types as you want with my custom implementation. I will let the community decide which version they want. |
Feature name
Media Element Subtitles
Link to discussion
#1867
Progress tracker
Summary
Add support for Subtitles to Media Element. Initial support for Windows, Mac, iOS, and Android. Subtitle format allowed at launch include srt and sub.
Windows
Android
IOS
2024-05-09.17-11-43.mp4
Motivation
I would like to help support people who have difficulty with hearing or need assistance in loud noisy environments where it is hard to hear the dialogue. Or people that want translations of foreign languages spoken that they do not know. Other people just like subtitles. This will add robust support that can be expanded later.
Detailed Design
API:
Usage Syntax
XAML Usage:
C# Code behind example
Drawbacks
Currently it uses a custom class to read the subtitle files and convert them to strings that can be used at specific times in a text box appropriate for each OS. This is a new class that only supports plain text at the moment. Non standard files and RTF formatted files are not supported.
Alternatives
The custom class for reading subtitle files was written to allow iOS and Mac Catalyst support as the current methods are to use m3u8 files and do not support directly linking a subtitle file. ATM we have support for m3u8 files but we have no control over how or what is displayed at all. Android and Windows both have robust libraries that support subtitles. They do not support any common format of subtitles.
ATM if you want uniform support for multiple different formats on each and every device my custom class is the way to go.
Unresolved Questions
Do we want to use this custom implementation or go with native libraries? I have both ready for testing.
The text was updated successfully, but these errors were encountered: