• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - AirPlay 未出现在 iOS 10 中

[复制链接]
菜鸟教程小白 发表于 2022-12-11 17:50:19 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

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

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

@property (weak, nonatomic) IBOutlet UIView *airplay;

MPVolumeView *myVolumeView = [[MPVolumeView alloc] initWithFrame: airplay.bounds];
[myVolumeView setShowsVolumeSlider:NO];
[myVolumeView setShowsRouteButton:YES];
myVolumeView.transform = CGAffineTransformMakeScale(0.3,0.3);
[myVolumeView setRouteButtonImage:[UIImage imageNamed"myIconAirPlay"] forState:UIControlStateNormal];
[airplay addSubview: myVolumeView];



Best Answer-推荐答案


来自苹果文档:

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. https://developer.apple.com/reference/mediaplayer/mpvolumeview

您是否检查过 var areWirelessRoutesAvailable: Bool { get }MPVolumeView 上返回 true 还是 false?

我认为这是您的按钮不再出现的原因,如果 iOS10 更新破坏了某些 Airplay 设备,直到它们也被更新,这也不是什么新鲜事。

关于ios - AirPlay 未出现在 iOS 10 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40037232/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap