[Proposal] Add Subtitle Support to Media Element #1899
Labels
approved
This Proposal has been approved and is ready to be added to the Toolkit
champion
A member of the .NET MAUI Toolkit core team has chosen to champion this feature
📽️ MediaElement
Issue/PR that has to do with MediaElement
proposal
A fully fleshed out proposal describing a new feature in syntactic and semantic detail
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
How are we going to use/add fonts? Are we going to go the normal route and just add fonts to the project and import them like any other maui project? Are we going to just use built in supported OS fonts for each device?
The text was updated successfully, but these errors were encountered: