Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
findChromeCasts() {
if (this.chromecastSearching) return
console.log("Searching for chromecast devices");
this.chromecastSearching = true;
chromecasts().on('update', player => {
console.log("Found a chromecast", player.name)
const newPlayer = new ChromeCastDevice(player)
if (!(newPlayer.id in self.devices.CHROMECAST)) {
self.devices.CHROMECAST[newPlayer.id] = newPlayer
self.emit("devicelist:newdevice", {
type: "ChromeCast",
device: newPlayer
})
}
})
}