DevBytes: Android 4.4 Closed Captioning

Android Developers · 15K views · 2013 · 2:58

Open on YouTube

Software (other)Consumer devices & gadgetstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when working out how to attach subtitles to a VideoView and how to send users to the system captioning settings on KitKat and later.

Recommended by 1 people across 1 different months, 2013 to 2020.

What it is

A short Android Developers DevBytes video showing how to display closed captions in an app's videos on Android 4.4 KitKat. It covers attaching timed text tracks (WebVTT) to a VideoView and letting users customize caption appearance through system settings.

What people said

Recommends Princeps Polycap · 2020-09 · Stack Overflow · on “Andorid VideoView not adding VTT subtitles in player”

After trying this find an answer to this for days, my colleague shared with me this video by DevBytes [this video] I noticed from it that I wasn't doing this: override fun onCreateOptionsMenu(menu: Menu?): Boolean { val inflater: MenuInflater = menuInflater inflater.inflate(R.menu.menu_closed_caption, menu) return true } override fun onOptionsItemSelected(item: MenuItem): Boolean { return when (item.itemId) { R.id.closedCaptionMenuItem -> { startActivity(Intent(Settings.ACTION_CAPTIONING_SETTINGS)) true } else -> super.onOptionsItemSelected(item) } } Essentially I hadn't enabled captioning in the settings and thus weren't showing up. Hopefully, this helps you. Good day

Cites user3045705 · 2013-11 · Stack Overflow · on “android kitkat videoView.addSubtitleSource”

I'm trying to add closed captioning on a videoView and found a [this video] that explained what to do. In KitKat they added a new feature videoView.addSubtitleSource that adds a webvtt file that contains the subtitles. I could not get this to work. Has anyone got this to work? Could you share a working example of how to do it? Thanks in advance.

Cites Simon Marquis · 2014-08 · Stack Overflow · on “How to disable captions in Youtube Android API?”

Since Android 4.4, close captioning is a System feature. You can redirect the user on the corresponding settings page : startActivityForIntent(new Intent(Settings.ACTION_CAPTIONING_SETTINGS)); Source [this video]