-
-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infer subtitle codec from delivery URL if unknown
- Loading branch information
1 parent
dae017c
commit 528731e
Showing
6 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
app/src/main/java/org/jellyfin/androidtv/ui/playback/VideoManagerHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.jellyfin.androidtv.ui.playback | ||
|
||
import androidx.core.net.toUri | ||
import org.jellyfin.playback.media3.exoplayer.mapping.getFfmpegSubtitleMimeType | ||
import org.jellyfin.sdk.model.api.MediaStream | ||
|
||
fun getSubtitleMediaStreamCodec(stream: MediaStream): String { | ||
val codec = requireNotNull(stream.codec) | ||
|
||
return getFfmpegSubtitleMimeType( | ||
codec = codec, | ||
// Try to infer the codec from the delivery URL extension | ||
fallback = stream.deliveryUrl?.toUri()?.lastPathSegment?.split('.')?.last()?.let(::getFfmpegSubtitleMimeType) ?: codec, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters