From 611c3330312cb662fa1c9641a4fa931912c2bc42 Mon Sep 17 00:00:00 2001 From: Palloquin Date: Tue, 21 Nov 2017 13:17:09 +0100 Subject: [PATCH] add self to connect callback I'm trying to use multiple clients to multiple chromecasts. It would be very handy (and very easy!) if the connect callback would contain a reference to the client. I achieved this by adding the 'self' object as argument to the 'callback()' call --- lib/senders/platform.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/senders/platform.js b/lib/senders/platform.js index 265f4c1..899aaa3 100644 --- a/lib/senders/platform.js +++ b/lib/senders/platform.js @@ -58,7 +58,7 @@ PlatformSender.prototype.connect = function(options, callback) { self.connection.connect(); self.heartbeat.start(); - callback(); + callback( self ); }); }; @@ -117,4 +117,4 @@ PlatformSender.prototype.getVolume = function(callback) { this.receiver.getVolume(callback); }; -module.exports = PlatformSender; \ No newline at end of file +module.exports = PlatformSender;