菜鸟教程小白 发表于 2022-12-12 03:55:01

ios - 如何让 Airplay 使用加密的 HTTPS 流媒体?


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

<p>阅读 <a href="http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/AirPlayGuide/EncryptionandAuthentication/EncryptionandAuthentication.html" rel="noreferrer noopener nofollow">this page by Apple</a>对我没什么好处。</p>

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

<p><strong>我只能让它在模拟器中工作。不在设备上。</strong></p>

<blockquote>
<p>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.</p>
</blockquote>

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

<blockquote>
<p>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.</p>
</blockquote>

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

<p>如果有人能以与 AVPlayer 和 AirPlay 一起使用的方式解决加密 key 服务问题,我将不胜感激。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>iOS 5.1.1 更新和随后的 Apple TV 更新似乎让我苦苦挣扎的麻烦消失了。 iOS 5.1.1 更新不足以单独解决该问题,但与随后的 Apple TV 更新一起,一切都很好,又一次很棒。</p>

<p>现在实现您自己的环回服务器就足够了,正如我在前面的 <a href="https://stackoverflow.com/questions/9000614/how-to-let-avplayer-retrieve-playlist-secured-by-ssl/" rel="noreferrer noopener nofollow">question</a> 中所描述的那样。 . </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 如何让 Airplay 使用加密的 HTTPS 流媒体?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/10330849/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/10330849/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 如何让 Airplay 使用加密的 HTTPS 流媒体?