我想从 ExoPlayer 上的本地存储中添加字幕,但是所有解决方案都是针对远程的,我尝试使用下面的代码,但不会发声。
File file = new File(Environment.getExternalStoragePublicDirectory(""), "subtitle1.srt");
SingleSampleMediaSource frSource = new SingleSampleMediaSource(
Uri.parse(file.getAbsolutePath()),
dataSourceFactory,
Format.createTextSampleFormat(null, MimeTypes.APPLICATION_SUBRIP, 25, "fa"),
C.TIME_UNSET);
mediaSources[1] = frSource;