I'm working on a native Android application that streams HLS video. I'm trying to get CEA-608 closed caption data to display, but I'm running into a problem.
Methodology: I'm running on a Jelly bean device (API 4.1+), which supports closed captions and HLS playback (http://developer.android.com/about/versions/android-4.1.html#Multimedia).
Test Feed: I'm testing using the Apple sample HLS bip-bop feed that contains captions data (https://devimages.apple.com.edgekey.net/resources/http-streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8)
Grabbing Caption Data: As per the Android documentation, I'm attempting to get the caption track by calling:
"MediaPlayer.getTrackInfo()"
Problem: The player crashes when I execute the getTrackInfo() line, with the following output in LogCat:
E/AndroidRuntime(7311): FATAL EXCEPTION: main E/AndroidRuntime(7311): java.lang.RuntimeException: failure code: -38
Questions: 1) Is closed caption rendering from in-stream caption data on an HLS feed supported in native Android apps? 2) If not, are there alternatives? 3) The documentation in the link above (quoted below) indicates that in-stream captions are supported on MP4 or 3GPP media sources. Does that necessarily exclude HLS (which I believe is MPEG-2 based) from working?
The MediaPlayer now handles both in-band and out-of-band text tracks. In-band text tracks come as a text track within an MP4 or 3GPP media source. Out-of-band text tracks can be added as an external text source via addTimedTextSource() method. After all external text track sources are added, getTrackInfo() should be called to get the refreshed list of all available tracks in a data source.
Thanks for any help you can offer!