如何解决android exoplayer2 播放视频时添加字幕
我想在播放时为视频添加字幕
此代码在播放视频前添加字幕:
Format textFormat = Format.createTextSampleFormat(null,MimeTypes.APPLICATION_SUBRIP,null,Format.NO_VALUE,"en",Format.OFFSET_SAMPLE_RELATIVE);
MediaSource textMediaSource = new SingleSampleMediaSource.Factory(selectedfile)
.createMediaSource(selectedfile,textFormat,C.TIME_UNSET);
MergingMediaSource mediaSource = new MergingMediaSource(videoSource,textMediaSource);
player.prepare(mediaSource,false,false);
如何在 VLC 或 KMPlayer 等视频播放时添加字幕?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。