菜鸟教程小白 发表于 2022-12-11 17:50:19

ios - AirPlay 未出现在 iOS 10 中


                                            <p><p><strong>已解决</strong>
在 iOS 10.2 中,AirPlay 按钮重新出现并且仍然有效。苹果的恶作剧!</p>

<p>在 iOS 9 中,我使用此代码来检测 Airplay 设备。对于部署目标 10.00,它不会出现。在控制中心,我可以找到我的播放设备,但在我的应用程序中,uiview 没有显示任何内容。
在我的能力范围内,我检查了“背景模式”、音频、AirPlay 和画中画。也许我忘记了这个祝福沙盒的一些新设置?
感谢您的耐心等待</p>

<pre><code>@property (weak, nonatomic) IBOutlet UIView *airplay;

MPVolumeView *myVolumeView = [ initWithFrame: airplay.bounds];
;
;
myVolumeView.transform = CGAffineTransformMakeScale(0.3,0.3);
forState:UIControlStateNormal];
;
</code></pre></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>来自苹果文档:</p>

<blockquote>
<p>If there is an Apple TV or other AirPlay-enabled device in range, the route button allows the user to choose it. If there is only one audio output route available, the route button is not displayed.
<a href="https://developer.apple.com/reference/mediaplayer/mpvolumeview" rel="noreferrer noopener nofollow">https://developer.apple.com/reference/mediaplayer/mpvolumeview</a></p>
</blockquote>

<p>您是否检查过 <code>var areWirelessRoutesAvailable: Bool { get }</code> 在 <code>MPVolumeView</code> 上返回 true 还是 false?</p>

<p>我认为这是您的按钮不再出现的原因,如果 iOS10 更新破坏了某些 Airplay 设备,直到它们也被更新,这也不是什么新鲜事。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - AirPlay 未出现在 iOS 10 中,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/40037232/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/40037232/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - AirPlay 未出现在 iOS 10 中