I am developing an audio player for iOS using Swift. Currently, the player can play DRM-protected videos, supports subtitles, and allows you to change the audio track. All these features are also available when using ChromeCast.
I would like to add support for playing DRM protected videos via AirPlay. Normal videos work without problems with AirPlay.
Despite extensive research, I have been unable to find relevant or current information on this topic and the iOS documentation has not been helpful.
Can anyone provide guidance or resources on how to enable DRM protected video playback over AirPlay?
func launchAirPlay() {
let rect = CGRect(x: -100, y: 0, width: 0, height: 0)
let airplayVolume = MPVolumeView(frame: rect)
airplayVolume.showsVolumeSlider = false
self.view.addSubview(airplayVolume)
for view: UIView in airplayVolume.subviews {
if let button = view as? UIButton {
button.sendActions(for: .touchUpInside)
break
}
}
airplayVolume.removeFromSuperview()
pause()
}
Javier Núñez León is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.