handleMethodCall method

Future handleMethodCall(
  1. MethodCall call
)

Handles method calls over the MethodChannel of this plugin. Note: Check the "federated" architecture for a new way of doing this: https://flutter.dev/go/federated-plugins

Implementation

Future<dynamic> handleMethodCall(MethodCall call) async {
  switch (call.method) {
    case 'getPlatformVersion':
      return getPlatformVersion();
    case 'get_room':
    case 'get_local_peer':
    case 'get_track_by_id':
    case 'get_all_tracks':
      final json = await promiseToFuture(
          hmssdkjsHandleMethodCall(call.method, jsonEncode(call.arguments)));
      return jsonDecode(json);
    default:
      return promiseToFuture(
          hmssdkjsHandleMethodCall(call.method, jsonEncode(call.arguments)));
  }
}