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

Add SRT (SubRip) subtitle support #388

Merged

Conversation

rolandkakonyi
Copy link
Contributor

Description

This PR adds support for SubRip (SRT) subtitle support for side-loaded subtitles.
In #387 the build broke due to the iOS Player update changes with new enum values.

Changes

Added support for SRT subtitles by mapping the relevant enum cases and mime types accordingly.

Checklist

  • 🗒 CHANGELOG entry

@rolandkakonyi rolandkakonyi self-assigned this Jan 26, 2024
@rolandkakonyi rolandkakonyi changed the base branch from development to update_ios_player_to_3.55.0 January 26, 2024 10:03
@rolandkakonyi rolandkakonyi marked this pull request as ready for review January 26, 2024 10:04
Copy link
Contributor

@strangesource strangesource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, just some nit.

@@ -530,7 +530,12 @@ fun ReadableMap.toSubtitleTrack(): SubtitleTrack? {
/**
* Converts any subtitle format name in its mime type representation.
*/
private fun String.toSubtitleMimeType(): String = "text/$this"
private fun String.toSubtitleMimeType(): String = when (this) {
"vtt" -> "text/vtt"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, same as the else branch, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, fixed in cc2198e

@rolandkakonyi rolandkakonyi merged commit eaf89f1 into update_ios_player_to_3.55.0 Jan 26, 2024
9 checks passed
@rolandkakonyi rolandkakonyi deleted the feature/add-SRT-subtitle-support branch January 26, 2024 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants