startDiscoveryController method
Implementation
static Future<void> startDiscoveryController(
DiscoveryCallback callback) async {
try {
await _channel.invokeMethod('startDiscoveryController');
_discoveryControllerChannel.receiveBroadcastStream().listen((json) {
debugPrint(json.toString());
callback(
json['event'] == 'found'
? PlayerDiscoveryStatus.Found
: PlayerDiscoveryStatus.Lost,
RemoteMediaPlayer.fromJson(json));
});
} on PlatformException catch (e) {
print('error starting discovery: ${e.details}');
}
}