【问题标题】:Detecting if I am the only Chromecast sender app connected to a Chromecast device检测我是否是唯一连接到 Chromecast 设备的 Chromecast 发件人应用
【发布时间】:2015-01-22 15:03:19
【问题描述】:

根据

https://developers.google.com/cast/docs/design_checklist#sender-control-end

Sender stops cast

Content which is cast to a TV continues playing until either the last 
connected sender disconnects, or until a sender casts something new.

Required
A   When the last or only sender is connected to a receiver, tapping
    Disconnect stops the app running on the receiver, and either 
    continues playing or pauses on the sender device. 

我正在使用 Google 的 castcompanionlibrary。

如果我这样做

mgr.setStopOnDisconnect(false);

当最后一个发送者断开连接时,它不会停止接收者应用程序。如果我将其设置为true,它会停止接收者应用程序,即使它不是唯一连接的发送者应用程序。

我需要在发送方应用程序中执行什么操作,以便它仅在最后一个发送方断开连接时停止接收方应用程序?也就是说,当用户想要断开连接时,我需要检查我是否是当前连接的最后一个/唯一的发送方应用,如果是,请先停止接收方应用,然后断开连接。

【问题讨论】:

    标签: android chromecast


    【解决方案1】:

    发件人没有这样做;发件人通常不知道有多少其他已连接的发件人在那里,他们也不需要知道。但是,接收者拥有该信息,并且在需要时应该停止该应用程序。正确的行为/代码记录在here;查找“会话管理”小节。请注意,默认/样式接收器已经这样做了。

    【讨论】:

      猜你喜欢
      • 2015-06-30
      • 2016-08-08
      • 1970-01-01
      • 2013-10-31
      • 1970-01-01
      • 2014-03-26
      • 1970-01-01
      • 2014-11-09
      • 1970-01-01
      相关资源
      最近更新 更多