Chromecast button not hiding

I use google casting through my application. It works well, but I can’t hide the cast button when the molded device goes offline. It hides automatically, but after a long time. How can I hide it immediately. Is there a way to get notifications from the device scanner class.

+3
source share
1 answer

You should try adding a listener.

[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];
}

Update

Similar question .

+2
source

All Articles