是的,ExoPlayer 2 的 SimpleExoPlayerView 没有 'setSubtitleView' 函数。但是,你可以通过以下方式设置字幕视图:

  1. 创建一个 SubtitleView 对象:
SubtitleView subtitleView = new SubtitleView(context);
  1. 将 SubtitleView 添加到 SimpleExoPlayerView 中:
simpleExoPlayerView.addView(subtitleView);
  1. 将 SubtitleView 与 ExoPlayer 关联起来:
player.setSubtitleView(subtitleView);

这样,你就可以使用 SubtitleView 来显示字幕了。注意,你需要使用适当的字幕格式和编码,以便 ExoPlayer 可以正确地解析和显示字幕。


原文地址: https://www.cveoy.top/t/topic/jH6Z 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录