If you want to do the same for Chromecast it's not possible yet. Google seems to have locked down their API. There is some open-source projects that are trying to reverse engineer it but the problem seems to be linked to crypto keys used to authenticate real Chromecast devices: https://github.com/thibauts/node-castv2/issues/2