Add SAMI subtitle decoder
I've searched here and there for history checkup.. and nothing showed up and no one asked... Why is showing SAMI not so popular issue?
Thanks for your precious time in advance.
You can set the preferred subtitle language in the parameters of DefaultTrackSelector. The parameters builder has a method setPreferredTextLanguage which accepts language codes (e.g. "smi"). Note that this still requires that the media contains a text track for the preferred language.
@tonihei Thanks for your time!
I thought that was actually choosing "language"...
I'm not sure if you got my point actually, I'm trying to merge Mediasources before playing the media, so I was looking for proper MimeTypes like MimeTypes.TEXT_VTT.
private fun getVTTSubtitleMediaSource(subtitleUri:String, language:String): MediaSource { val vttFormat = Format.createTextSampleFormat("identifier", MimeTypes.TEXT_VTT, 0, language) return SingleSampleMediaSource.Factory(DefaultHttpDataSourceFactory("ua")).createMediaSource(Uri.parse( subtitleUri ), vttFormat, C.TIME_UNSET) }
Can you explain this perspective..? What can I do to achieve this?
I'm not sure I fully understand the problem.
If you merge a subtitle MediaSource as in the example you just provided, the selection process is still the same as if that subtitle track has been part of the media all along. By default, no text track is selected unless it's marked as forced in the selectionFlags parameter of the Format. And you can specify a preferred language using the parameters to select a track of that language.
I'm so sorry to confuse you. My question is about file extension smi
Probably my bad english helped(not helped).
My clear question would be this
MimeType for SUBTITLE_LINK.vtt would be MimeTypes.TEXT_VTT
MimeType for SUBTITLE_LINK.srt would be MimeTypes.APPLICATION_SUBRIP
My question is, MimeType for SUBTITLE_LINK.smi would be ???
Ah, I think I understand the problem now :)
You are not talking about the Sami language with "smi" language code, but about the Sami subtitle format with "smi" file extension. I wasn't aware that this format exists - sorry for the confusion.
In this case, the answer is that it is not possible to play that with the ExoPlayer at the moment, because we don't have a decoder for SAMI subtitles. If you are sufficiently motivated to write one, you can do that in the same style as the other subtitle decoders in this directory. We would also accept pull requests for high-quality code contributions.
I'll also mark this issue as an enhancement because we don't currently support this format.
No- my english wasn't good enough to deliver what I was asking.
Thank you for the quick and clear answer, I clearly didn't even know existence of language Sami. My knowledge about subtitle is very short and personally I'm chasing by time a lot recently, So I'll need to tell my coworkers to only accept srt or vtt extensions for now.
Thank you so much and good luck with your project! ExoPlayer is such a great work with lots of effort by numerous people.
Thanks, good to know. I'll also mark as "low priority" because this support has not been requested so far and we are unlikely to add it soon (unless someone provides a pull request).
I request support sami subtitles, too. Most Koreans use sami subtitles.
Good day! Is there any progress on the ticket?