OGeek|极客世界-中国程序员成长平台

标题: ios - 如何让 Airplay 使用加密的 HTTPS 流媒体? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 03:55
标题: ios - 如何让 Airplay 使用加密的 HTTPS 流媒体?

我一直在努力让 AirPlay 与在 AVPlayer 中播放的加密流一起工作。

阅读 this page by Apple对我没什么好处。

Serve keys from a protected HTTPS realm. Before playback begins, your app can use NSURLConnection to authenticate itself, providing credentials that are kept hidden.

我只能让它在模拟器中工作。不在设备上。

Use cookies over HTTPS. Your app can make a connection to an HTTPS server and authenticate the application in an application-defined way. Your server can then issue a cookie that applies to the key URLs. You should set the cookie to expire long after playback is complete. The server must then require the presence of a valid session cookie in future GET requests for the keys. For maximum reliability, if the expiration date is in the near future, the server should update the cookie’s expiration date in its response to future GET requests.

实际上没有尝试过,因为我没有直接访问服务器设置的权限,但如果没有其他答案出现,我会尝试。

Specify the keys in the .m3u8 files using an application-defined URL scheme. The app should register a custom NSURLProtocol to handle requests for those URLs. The player then calls back into your app when it needs to load a key URL; your app can then obtain the key using a secure side channel and can provide it to the player.

这似乎不起作用,因为 AVPlayer HTTP 连接完全绕过了 NSURLProtocol 系统。您只是无法拦截 AVPlayer 发出的任何 HTTP 请求。

如果有人能以与 AVPlayer 和 AirPlay 一起使用的方式解决加密 key 服务问题,我将不胜感激。



Best Answer-推荐答案


iOS 5.1.1 更新和随后的 Apple TV 更新似乎让我苦苦挣扎的麻烦消失了。 iOS 5.1.1 更新不足以单独解决该问题,但与随后的 Apple TV 更新一起,一切都很好,又一次很棒。

现在实现您自己的环回服务器就足够了,正如我在前面的 question 中所描述的那样。 .

关于ios - 如何让 Airplay 使用加密的 HTTPS 流媒体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10330849/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4