setup static method

void setup(
  1. THEOplayerFlutterAudioTracksAPI? api, {
  2. BinaryMessenger? binaryMessenger,
})

Implementation

static void setup(THEOplayerFlutterAudioTracksAPI? api, {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAddAudioTrack', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAddAudioTrack was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_id = (args[0] as String?);
        final int? arg_uid = (args[1] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAddAudioTrack was null, expected non-null int.');
        final String? arg_label = (args[2] as String?);
        final String? arg_language = (args[3] as String?);
        final String? arg_kind = (args[4] as String?);
        final bool? arg_isEnabled = (args[5] as bool?);
        assert(arg_isEnabled != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAddAudioTrack was null, expected non-null bool.');
        try {
          api.onAddAudioTrack(arg_id, arg_uid!, arg_label, arg_language, arg_kind, arg_isEnabled!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAudioTrackAddQuality', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAudioTrackAddQuality was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_audioTrackUid = (args[0] as int?);
        assert(arg_audioTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAudioTrackAddQuality was null, expected non-null int.');
        final String? arg_qualityId = (args[1] as String?);
        assert(arg_qualityId != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAudioTrackAddQuality was null, expected non-null String.');
        final int? arg_qualityUid = (args[2] as int?);
        assert(arg_qualityUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAudioTrackAddQuality was null, expected non-null int.');
        final String? arg_name = (args[3] as String?);
        final int? arg_bandwidth = (args[4] as int?);
        assert(arg_bandwidth != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAudioTrackAddQuality was null, expected non-null int.');
        final String? arg_codecs = (args[5] as String?);
        final int? arg_audioSamplingRate = (args[6] as int?);
        assert(arg_audioSamplingRate != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAudioTrackAddQuality was null, expected non-null int.');
        try {
          api.onAudioTrackAddQuality(arg_audioTrackUid!, arg_qualityId!, arg_qualityUid!, arg_name, arg_bandwidth!, arg_codecs, arg_audioSamplingRate!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onRemoveAudioTrack', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onRemoveAudioTrack was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onRemoveAudioTrack was null, expected non-null int.');
        try {
          api.onRemoveAudioTrack(arg_uid!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAudioTrackListChange', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAudioTrackListChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_uid = (args[0] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onAudioTrackListChange was null, expected non-null int.');
        try {
          api.onAudioTrackListChange(arg_uid!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onTargetQualityChange', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onTargetQualityChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_audioTrackUid = (args[0] as int?);
        assert(arg_audioTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onTargetQualityChange was null, expected non-null int.');
        final List<int?>? arg_qualitiesUid = (args[1] as List<Object?>?)?.cast<int?>();
        assert(arg_qualitiesUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onTargetQualityChange was null, expected non-null List<int?>.');
        final int? arg_qualityUid = (args[2] as int?);
        try {
          api.onTargetQualityChange(arg_audioTrackUid!, arg_qualitiesUid!, arg_qualityUid);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onActiveQualityChange', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onActiveQualityChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_audioTrackUid = (args[0] as int?);
        assert(arg_audioTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onActiveQualityChange was null, expected non-null int.');
        final int? arg_qualityUid = (args[1] as int?);
        assert(arg_qualityUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onActiveQualityChange was null, expected non-null int.');
        try {
          api.onActiveQualityChange(arg_audioTrackUid!, arg_qualityUid!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onQualityUpdate', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      channel.setMessageHandler(null);
    } else {
      channel.setMessageHandler((Object? message) async {
        assert(message != null,
        'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onQualityUpdate was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_audioTrackUid = (args[0] as int?);
        assert(arg_audioTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onQualityUpdate was null, expected non-null int.');
        final int? arg_qualityUid = (args[1] as int?);
        assert(arg_qualityUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onQualityUpdate was null, expected non-null int.');
        final String? arg_name = (args[2] as String?);
        final int? arg_bandwidth = (args[3] as int?);
        assert(arg_bandwidth != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onQualityUpdate was null, expected non-null int.');
        final String? arg_codecs = (args[4] as String?);
        final int? arg_audioSamplingRate = (args[5] as int?);
        assert(arg_audioSamplingRate != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAudioTracksAPI.onQualityUpdate was null, expected non-null int.');
        try {
          api.onQualityUpdate(arg_audioTrackUid!, arg_qualityUid!, arg_name, arg_bandwidth!, arg_codecs, arg_audioSamplingRate!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
}