Android MediaPlayer/VideoView w/Subtitles (SRT)

走远了吗. 提交于 2019-11-28 21:34:37

问题


Does Android's MediaPlayer support SRT subtitles? I've attempted to place the SRT file in the same directory as the video file and name it the same (with the exception of the extension of course), but haven't had any luck getting them to display. Any thoughts, recommendations?


回答1:


Android 4.0.x version and below

In case of Android 4.0 version and below, default Media Player did not support subtitles.

There are third party player apps available in Google Play which support subtitles. One of them is MoboPlayer

If you are planning to do it using code, the following link is a good resource http://www.ittiam.com/wp-content/knowledge-center/whitepapers/WP006_rendering-subtitles-in-android.pdf

Android 4.1 (Jelly Bean - JB))

Android JB version has built in support for internal (present in MP4 files) and SRT external subtitles. More details is available at http://developer.android.com/about/versions/android-4.1.html#Multimedia




回答2:


Here is the awesome post on Subtitles support on Pre-Jellybean devices. Worked pretty well for me, indeed better than native support on 4.1. Hope this helps.

Update: I made a demo project in my blog for code reference



来源:https://stackoverflow.com/questions/11403134/android-mediaplayer-videoview-w-subtitles-srt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!