Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chromecast button not hiding

I am using google casting through my app. It is working good but I am not able to hide the casting button when the cast device goes offline. It hides automatically but after a long time. How can I hide it immediately. Is there a way to get the notifications from the device scanner class.

like image 257
user3308898 Avatar asked Dec 01 '25 03:12

user3308898


1 Answers

You should try adding 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.

like image 94
brainforked Avatar answered Dec 02 '25 18:12

brainforked