1

I take subtitle from URL and display it in exoplayer, but the subtitle content is full of symbols because the language of the text is Arabic, Greek, Chinese, etc. How do I encode MediaScource to UTF8 before displaying it in the video?

Here is my code to prepare the content of the subtitles:

MediaSource subtitleSource = 
    new SingleSampleMediaSource
            .Factory(dataSourceFactory)
            .createMediaSource(
                Uri.parse(subtitlesUrl), 
                subtitleFormat, 
                C.TIME_UNSET
            )
;

With this code it loads the subtitles correctly but only in English.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
JackMorris
  • 11
  • 2
  • Does this answer your question? [ExoPlayer - Weird Arabic/Persian Subtitles Format](https://stackoverflow.com/questions/48892533/exoplayer-weird-arabic-persian-subtitles-format) – Pradipto SenSarma Aug 05 '22 at 21:09

0 Answers0