如何播放受DRM保护的内容? [关闭]

问题描述 投票:0回答:1

我不熟悉iOS开发,需要播放受DRM保护的内容吗?有人可以帮我提供示例代码。

我能够投射示例“ BucksBunny”(没有受DRM保护的内容,并使用MPVolumeView创建投射按钮功能。

func showAirplay() {
    let rect = CGRect(x: -100, y: 0, width: 0, height: 0)
    let airplayVolume = MPVolumeView(frame: rect)
    airplayVolume.showsVolumeSlider = false
    airplayVolume.setRouteButtonImage(UIImage(named: "airplay"), for: .normal)
    self.view.addSubview(airplayVolume)
    for view: UIView in airplayVolume.subviews {
        if let button = view as? UIButton {
            button.sendActions(for: .touchUpInside)
            break
        }
    }
    airplayVolume.removeFromSuperview()
}
ios swift drm airplay
1个回答
0
投票

尝试将@property BOOL allowsExternalPlayback;属性设置为true

https://developer.apple.com/documentation/avfoundation/avplayer/1387441-allowsexternalplayback?language=objc

干杯。

© www.soinside.com 2019 - 2024. All rights reserved.