I'm trying to play a movie that has closed captions embedded in the file (.scc) using an instance of MPMoviePlayerController. I've read the documentation and don't see support to turn captions on with this class. I know Apple allows a user to turn on captions for movies from iTunes. Anyone know of a particular way to do this that I might be overlooking?
2 Answers
On iOS 4.0 and later, you can also use the AVPlayer class. It natively supports closed caption (see the closedCaptionDisplayEnabled property).

- 81
- 1
- 2
-
1Does 'closedCaptionDisplayEnabled' turn on/off the soft-subtitle embedded in the video file? What if the file has multiple subtitle tracks, can I choose between, for example, english or french programmatically? The documentation says almost nothing, any help you can provide is greatly appreciated. Thanks! – Joseph Lin Jan 17 '12 at 16:10
Unfortunately, as far as I know, there's no way to do this automatically. However, it's not too hard to do by yourself if you're using iOS3.2+.
In iOS3.2+, MPMoviePlayerController conforms to the MPMediaPlayback protocol, meaning that you can access at any time the "playback head" to determine where you are in the file.
I don't know about the SCC file format in particular, but if you had a list of subtitles and start/end timecodes associated with them (which appears to be the basis of most of the subtitle formats out there), you could just check the "playback head" time at regular intervals, see if it matches any of the sets of subtitles you have, and display by adding a subview to the movie view.

- 6,402
- 3
- 31
- 56