setup static method

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

Implementation

static void setup(THEOplayerFlutterVideoTracksAPI? api, {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.onAddVideoTrack', 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.THEOplayerFlutterVideoTracksAPI.onAddVideoTrack 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.THEOplayerFlutterVideoTracksAPI.onAddVideoTrack 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.THEOplayerFlutterVideoTracksAPI.onAddVideoTrack was null, expected non-null bool.');
        try {
          api.onAddVideoTrack(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.THEOplayerFlutterVideoTracksAPI.onVideoTrackAddQuality', 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.THEOplayerFlutterVideoTracksAPI.onVideoTrackAddQuality was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_videoTrackUid = (args[0] as int?);
        assert(arg_videoTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.onVideoTrackAddQuality 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.THEOplayerFlutterVideoTracksAPI.onVideoTrackAddQuality 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.THEOplayerFlutterVideoTracksAPI.onVideoTrackAddQuality 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.THEOplayerFlutterVideoTracksAPI.onVideoTrackAddQuality was null, expected non-null int.');
        final String? arg_codecs = (args[5] as String?);
        final int? arg_width = (args[6] as int?);
        assert(arg_width != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.onVideoTrackAddQuality was null, expected non-null int.');
        final int? arg_height = (args[7] as int?);
        assert(arg_height != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.onVideoTrackAddQuality was null, expected non-null int.');
        final double? arg_frameRate = (args[8] as double?);
        assert(arg_frameRate != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.onVideoTrackAddQuality was null, expected non-null double.');
        final double? arg_firstFrame = (args[9] as double?);
        assert(arg_firstFrame != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.onVideoTrackAddQuality was null, expected non-null double.');
        try {
          api.onVideoTrackAddQuality(arg_videoTrackUid!, arg_qualityId!, arg_qualityUid!, arg_name, arg_bandwidth!, arg_codecs, arg_width!, arg_height!, arg_frameRate!, arg_firstFrame!);
          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.THEOplayerFlutterVideoTracksAPI.onRemoveVideoTrack', 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.THEOplayerFlutterVideoTracksAPI.onRemoveVideoTrack 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.THEOplayerFlutterVideoTracksAPI.onRemoveVideoTrack was null, expected non-null int.');
        try {
          api.onRemoveVideoTrack(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.THEOplayerFlutterVideoTracksAPI.onVideoTrackListChange', 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.THEOplayerFlutterVideoTracksAPI.onVideoTrackListChange 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.THEOplayerFlutterVideoTracksAPI.onVideoTrackListChange was null, expected non-null int.');
        try {
          api.onVideoTrackListChange(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.THEOplayerFlutterVideoTracksAPI.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.THEOplayerFlutterVideoTracksAPI.onTargetQualityChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_videoTrackUid = (args[0] as int?);
        assert(arg_videoTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.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.THEOplayerFlutterVideoTracksAPI.onTargetQualityChange was null, expected non-null List<int?>.');
        final int? arg_qualityUid = (args[2] as int?);
        try {
          api.onTargetQualityChange(arg_videoTrackUid!, 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.THEOplayerFlutterVideoTracksAPI.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.THEOplayerFlutterVideoTracksAPI.onActiveQualityChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_videoTrackUid = (args[0] as int?);
        assert(arg_videoTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.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.THEOplayerFlutterVideoTracksAPI.onActiveQualityChange was null, expected non-null int.');
        try {
          api.onActiveQualityChange(arg_videoTrackUid!, 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.THEOplayerFlutterVideoTracksAPI.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.THEOplayerFlutterVideoTracksAPI.onQualityUpdate was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_videoTrackUid = (args[0] as int?);
        assert(arg_videoTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.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.THEOplayerFlutterVideoTracksAPI.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.THEOplayerFlutterVideoTracksAPI.onQualityUpdate was null, expected non-null int.');
        final String? arg_codecs = (args[4] as String?);
        final int? arg_width = (args[5] as int?);
        assert(arg_width != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.onQualityUpdate was null, expected non-null int.');
        final int? arg_height = (args[6] as int?);
        assert(arg_height != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.onQualityUpdate was null, expected non-null int.');
        final double? arg_frameRate = (args[7] as double?);
        assert(arg_frameRate != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.onQualityUpdate was null, expected non-null double.');
        final double? arg_firstFrame = (args[8] as double?);
        assert(arg_firstFrame != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterVideoTracksAPI.onQualityUpdate was null, expected non-null double.');
        try {
          api.onQualityUpdate(arg_videoTrackUid!, arg_qualityUid!, arg_name, arg_bandwidth!, arg_codecs, arg_width!, arg_height!, arg_frameRate!, arg_firstFrame!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
}