Skip to content

Detecting ChromeCast Connect and Disconnect Events #25

@joelongstreet

Description

@joelongstreet

Not sure if this is the right place to post this question, but I'm having issues detecting when ChromeCasts join and leave the network.

I originally thought this was a problem with the mdns lib and the way it polled, so I filed an issue. The author of node_mdns helped me out and it looks like the ChromeCast device is the culprit:

  • The first time the app starts, I receive a single serviceUp event for each ChromeCast on the network.
  • If i unplug a ChromeCast, no serviceDown event is sent.
  • If I add new ChromeCasts to the network after the app is started, I get no new serviceUp event.

Not sure if this is related, but after I start and stop my app a few times, I'll have to turn my wifi off and then on again to pick up serviceUps.

Sample App:

var mdns = require('mdns');
var browser = mdns.createBrowser(mdns.tcp('googlecast'));

browser.on('serviceUp', function(service){
  console.log('chromecast detected -', service.name);
});

browser.on('serviceDown', function(service){
  console.log('chromecast lost -', service.name);
});

browser.start();

Thanks for any help you can provide

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions