Steps to reproduce
I am downloading a ZIP file, extracting the .srt files into a temporary file using File.createTempFile, and adding them to the player using SubtitleResource().addFile().
Although I can verify that the downloaded .srt files are perfectly formatted and contain correct data (I have checked the files in the cache directory), the player fails to display any subtitles. The PlayerView shows SubtitlesUpdatedEvent but no tracks are loaded or the subtitle content appears empty.
To Reproduce
-
Fetch a ZIP archive containing .srt files.
-
Use SubtitleResource().addFile(tempFile, entry.name) to add the subtitle.
-
Pass the URL from subResource.getSubtitles() to the subtitleCallback.
-
val zipStream = ZipInputStream(zipBytes.inputStream())
var entry = zipStream.nextEntry
while (entry != null) {
if (!entry.isDirectory && entry.name.lowercase().endsWith(".srt")) {
val tempFile = File.createTempFile("sub", ".srt")
tempFile.writeBytes(zipStream.readBytes())
subResource.addFile(tempFile, entry.name)
}
entry = zipStream.nextEntry
}
zipStream.close()
subResource.getSubtitles().forEach { res ->
subtitleCallback(
newSubtitleFile(
lang = "Turkish",
url = res.url,
)
)
}
What am i doing wrong.
Expected behavior
The subtitles should be parsed and displayed correctly by the player.
Actual behavior
The subtitles not displayed
Cloudstream version and commit hash
4.7.0-PRE 2cde74d 3 Temmuz 2026 18:48:20
Android version
Android 16
Logcat
07-07 01:02:46.681 29581 29581 I CS3ExoPlayer: setPreferredSubtitles init SubtitleData(originalName=Turkish, nameSuffix=12, url=file:///data/user/0/com.lagradost.cloudstream3.prerelease/cache/sub7352673553558980328.srt, origin=URL, mimeType=application/x-subrip, headers={}, languageCode=tr)
07-07 01:02:46.681 29581 29581 I CS3ExoPlayer: setPreferredSubtitles IS_ACTIVE
07-07 01:02:46.720 29581 29581 I PlayerView: Handle event: EmbeddedSubtitlesFetchedEvent(tracks=[], source=Player)
07-07 01:02:46.725 29581 29581 I PlayerView: Handle event: SubtitlesUpdatedEvent(source=Player)
Other details
The .srt files are valid and readable when opened manually.
is local files are not supported what am i doing wrong?
Acknowledgements
Steps to reproduce
I am downloading a ZIP file, extracting the .srt files into a temporary file using File.createTempFile, and adding them to the player using SubtitleResource().addFile().
Although I can verify that the downloaded .srt files are perfectly formatted and contain correct data (I have checked the files in the cache directory), the player fails to display any subtitles. The PlayerView shows SubtitlesUpdatedEvent but no tracks are loaded or the subtitle content appears empty.
To Reproduce
What am i doing wrong.
Expected behavior
The subtitles should be parsed and displayed correctly by the player.
Actual behavior
The subtitles not displayed
Cloudstream version and commit hash
4.7.0-PRE 2cde74d 3 Temmuz 2026 18:48:20
Android version
Android 16
Logcat
Other details
The .srt files are valid and readable when opened manually.
is local files are not supported what am i doing wrong?
Acknowledgements