Skip to main content
Logo Appt Light

Closed captions

Automatically subtitling, e.g. of videos, is supported on both iOS and Android. But it differs in how it works. On iOS, this setting automatically activates closed captions for videos in the user’s preferred language, provided the creator of the video has facilitated this. On Android, the subtitles are automatically generated when this setting is selected. (Note: iOS 16 now includes the live captioning feature as well. This is still in beta. When it becomes available to everyone, we'll share its use here.)

People use this feature if they are deaf or hard of hearing. But this is also convenient when watching Netflix at the gym, for example. We extrapolate that upwards of 600,000 Dutch people have this feature on by default.

1.1%

have closed captions on by default on iOS.

4.09%

have closed captions on by default on Android.

Photo Darice

I’m not disabled, the world disables me.

Darice

Read the interview with Darice

Support in apps

In order for everyone to understand and experience media, it must be provided with captions or subtitles. Below are some code samples for the most commonly used platforms and frameworks.

On Android, captions can be added by using TimedText inside a MediaPlayer. The code example below shows a basic example.

val player = MediaPlayer.create(this, R.raw.video)
try {
    player.addTimedTextSource("/assets/appt.srt", MediaPlayer.MEDIA_MIMETYPE_TEXT_SUBRIP)
    player.trackInfo.forEachIndexed { index, trackInfo ->
        if (trackInfo.trackType == TrackInfo.MEDIA_TRACK_TYPE_TIMEDTEXT) {
            player.selectTrack(index)
            return@forEachIndexed
        }
    }
    player.setOnTimedTextListener(this)
    player.start()
} catch (e: Exception) {
    e.printStackTrace()
}

Feedback?

Let us know!