Swift AVPlayerViewController中的YouTube字幕/标题

时间:2018-07-06 16:08:32

标签: ios swift youtube swift4 closed-captions

有人让AVPlayerViewController显示YouTube的隐藏式字幕有任何经验吗?

我目前正在尝试使我的应用程序更易于访问。

到目前为止,我发现的唯一属性是:

try? AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)
try? AVAudioSession.sharedInstance().setActive(true)
let player = AVPlayer(url: videoURL)

// subtitle defaults
player.isClosedCaptionDisplayEnabled = true
player.appliesMediaSelectionCriteriaAutomatically = true

也许我需要单独使用或获取字幕流并在时间戳记下覆盖其他本地组件吗?任何帮助将不胜感激!

0 个答案:

没有答案