Chromecast按钮无法隐藏

时间:2014-02-14 07:57:45

标签: ios iphone google-cast

我正在通过我的应用使用谷歌投射。它运行良好,但是当演员设备离线时我无法隐藏转换按钮。它会在很长一段时间后自动隐藏。我该如何立即隐藏它。有没有办法从设备扫描仪类中获取通知。

1 个答案:

答案 0 :(得分:2)

你应该尝试添加监听器

[self.deviceScanner addListener:self];
[self.deviceScanner startScan];

#pragma mark - GCKDeviceScannerListener
- (void)deviceDidComeOnline:(GCKDevice *)device {
  NSLog(@"device found!! %@", device.friendlyName);
 [self updateCastIconButtonStates];
if ([self.delegate respondsToSelector:@selector(didDiscoverDeviceOnNetwork)]) {
[self.delegate didDiscoverDeviceOnNetwork];
 }
}

- (void)deviceDidGoOffline:(GCKDevice *)device {
  [self updateCastIconButtonStates];
}

<强>更新

Similar Question