Is there a way to show custom subtitles track name in AVPlayerViewController

846 Views Asked by At

AVPlayerViewController can perform a lot of work like switching audio/subtitles tracks, draw progress bar, retrieving thumbnails etc. On tvOS it automatically display builtin tracks in top bar and accept event from remote control. enter image description here

It recognize WebVTT subtitles and can display user selected track. But it doesn't work with SMPT-ETT/TTML subtitles. There is a way to manually decode and display subtitles of these formats. But is there a way to add a button with track language to a "Subtitles" chapter?

1

There are 1 best solutions below

0
On

If you create a new AVMediaSelectionOption of type AVMediaCharacteristicLegible and add it to AVAsset's mediaSelectionGroup(AVMediaSelectionGroup) and provide that asset to the AVPlayer it should show up in that list above the player.