我正在尝试创建一个带字幕的视频播放器。一切都已设置并正常工作,除了一件事。我的阿拉伯语字幕显示不正确。他们看起来很奇怪的符号和东西......像这样的东西:
这是我的带有 subtiltes 的 ExoPlayer 设置:
Uri srt = Uri.parse("http://download1651.mediafire.com/titdvyxje25g/j5wpodffdhn005r/Thor+3+.WEB+%28NoColored%29.srt");
Handler mainHandler = new Handler();
BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
TrackSelection.Factory videoTrackSelectionFactory =
new AdaptiveTrackSelection.Factory(bandwidthMeter);
TrackSelector trackSelector =
new DefaultTrackSelector(videoTrackSelectionFactory);
player =
ExoPlayerFactory.newSimpleInstance(this, trackSelector);
DefaultBandwidthMeter bandwidthMeter2 = new DefaultBandwidthMeter();
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this,
Util.getUserAgent(this, "yourApplicationName"), bandwidthMeter2);
Format textFormat = Format.createTextSampleFormat(null, MimeTypes.APPLICATION_SUBRIP,
null, Format.NO_VALUE, Format.NO_VALUE, "ar", null, Format.OFFSET_SAMPLE_RELATIVE);
MediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)
.createMediaSource(Uri.parse(getVideoUri()));
MediaSource textMediaSource = new SingleSampleMediaSource.Factory(dataSourceFactory)
.createMediaSource(srt, textFormat, C.TIME_UNSET);
MediaSource mediaSource = new MergingMediaSource(videoSource, textMediaSource);
player.prepare(mediaSource);
有没有关于如何解决这个问题的解决方案?