gpt4 book ai didi

ios - 谷歌 Chromecast SDK 后台拆解

转载 作者:行者123 更新时间:2023-11-28 22:12:30 25 4
gpt4 key购买 nike

使用 iOS Sender API Framework,当我的应用程序进入后台时,SDK 会断开所有连接,并且在应用程序返回前台之前我无法启动任何媒体。我的应用程序播放音频并允许在后台运行和流式传输。是否可以选择告诉 Googlecast 框架保持套接字打开?

这是后台日志:

信息:将主动辞职

信息:现在在后台

很好:-[GCKCastSocket 断开连接] 断开连接

很好:-[GCKCastSocket doTeardownWithError:] doTeardownWithError

FINE: -[GCKCastSocket doTeardownWithError:] 通知代理套接字已断开连接

很好:-[GCKHeartbeatChannel didDisconnect] 已断开连接 - 如有必要,停止心跳定时器

很好:-[GCKCastSocket socketDidDisconnect:withError:] socketDidDisconnect:withError: "(null)"

然后当应用程序恢复时:信息:进入前台

很好:-[GCKCastSocket doTeardownWithError:] doTeardownWithError

FINE: -[GCKCastSocket doTeardownWithError:] 通知代理套接字已断开连接

很好:-[GCKCastSocket connectToHost:port:withTimeout:] 连接到端口 8009l 上的“192.168.1.4”...

信息:已激活

很好:-[GCKCastSocket 套接字:didConnectToHost:端口:] socketDidConnect:

很好:-[GCKCastSocket socketDidSecure:] socketDidSecure:

FINE: -[GCKCastSocket socket:didReadData:withTag:] 前缀读取,预期消息长度=1307

FINE: -[GCKDeviceAuthChannel didReceiveBinaryMessage:] 正版谷歌设备 didDeviceAuthenticated=YES

FINE: -[GCKDeviceManager deviceAuthChannelDidAuthenticate:] 真实设备,连接接收器 channel

FINE: -[GCKCastSocket socket:didReadData:withTag:] 前缀读取,预期消息长度=474

FINE: -[GCKDeviceManager receiverControlChannel:didReceiveStatusForApplication:] 申请加入 (CC1AD845) 可用

很好:-[GCKDeviceManager connectAndNotifyDidConnectToApplication:launchedApplication:] 已连接到应用程序 <0x1467c8f0:GCKApplicationMetadata> 默认媒体接收器 (CC1AD845),传输 ID web-11

FINE: -[GCKCastSocket socket:didReadData:withTag:] 前缀读取,预期消息长度=135

很好:-[GCKMediaControlChannel didReceiveTextMessage:] 收到消息:{"type":"MEDIA_STATUS","status":[],"requestId":6}

最佳答案

在 iOS Sender API 的 2.0 版本中,GCKCastSocket 在收到 UIApplicationDidEnterBackgroundNotification 时关闭,这是不可配置的。

这意味着:

  • 当应用程序处于后台时,不能将新媒体从应用程序推送到 chromecast
  • 无法实现锁屏控制

备选方案(仅限自定义接收器):

  • 向接收方发送要播放的媒体列表
  • 直接从接收器从云端获取新媒体

另见 this questionthis one了解更多详情。

关于ios - 谷歌 Chromecast SDK 后台拆解,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22541221/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com