setup static method

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

Implementation

static void setup(THEOplayerFlutterTextTracksAPI? api, {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onAddTextTrack', 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.THEOplayerFlutterTextTracksAPI.onAddTextTrack 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.THEOplayerFlutterTextTracksAPI.onAddTextTrack 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 String? arg_inBandMetadataTrackDispatchType = (args[5] as String?);
        final TextTrackReadyState? arg_readyState = args[6] == null ? null : TextTrackReadyState.values[args[6]! as int];
        assert(arg_readyState != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onAddTextTrack was null, expected non-null TextTrackReadyState.');
        final TextTrackType? arg_type = args[7] == null ? null : TextTrackType.values[args[7]! as int];
        assert(arg_type != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onAddTextTrack was null, expected non-null TextTrackType.');
        final String? arg_source = (args[8] as String?);
        final bool? arg_isForced = (args[9] as bool?);
        assert(arg_isForced != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onAddTextTrack was null, expected non-null bool.');
        final TextTrackMode? arg_mode = args[10] == null ? null : TextTrackMode.values[args[10]! as int];
        assert(arg_mode != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onAddTextTrack was null, expected non-null TextTrackMode.');
        try {
          api.onAddTextTrack(arg_id, arg_uid!, arg_label, arg_language, arg_kind, arg_inBandMetadataTrackDispatchType, arg_readyState!, arg_type!, arg_source, arg_isForced!, arg_mode!);
          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.THEOplayerFlutterTextTracksAPI.onRemoveTextTrack', 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.THEOplayerFlutterTextTracksAPI.onRemoveTextTrack 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.THEOplayerFlutterTextTracksAPI.onRemoveTextTrack was null, expected non-null int.');
        try {
          api.onRemoveTextTrack(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.THEOplayerFlutterTextTracksAPI.onTextTrackListChange', 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.THEOplayerFlutterTextTracksAPI.onTextTrackListChange 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.THEOplayerFlutterTextTracksAPI.onTextTrackListChange was null, expected non-null int.');
        try {
          api.onTextTrackListChange(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.THEOplayerFlutterTextTracksAPI.onTextTrackAddCue', 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.THEOplayerFlutterTextTracksAPI.onTextTrackAddCue was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_textTrackUid = (args[0] as int?);
        assert(arg_textTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackAddCue was null, expected non-null int.');
        final String? arg_id = (args[1] as String?);
        assert(arg_id != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackAddCue was null, expected non-null String.');
        final int? arg_uid = (args[2] as int?);
        assert(arg_uid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackAddCue was null, expected non-null int.');
        final double? arg_startTime = (args[3] as double?);
        assert(arg_startTime != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackAddCue was null, expected non-null double.');
        final double? arg_endTime = (args[4] as double?);
        assert(arg_endTime != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackAddCue was null, expected non-null double.');
        final String? arg_content = (args[5] as String?);
        assert(arg_content != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackAddCue was null, expected non-null String.');
        try {
          api.onTextTrackAddCue(arg_textTrackUid!, arg_id!, arg_uid!, arg_startTime!, arg_endTime!, arg_content!);
          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.THEOplayerFlutterTextTracksAPI.onTextTrackRemoveCue', 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.THEOplayerFlutterTextTracksAPI.onTextTrackRemoveCue was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_textTrackUid = (args[0] as int?);
        assert(arg_textTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackRemoveCue was null, expected non-null int.');
        final int? arg_cueUid = (args[1] as int?);
        assert(arg_cueUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackRemoveCue was null, expected non-null int.');
        try {
          api.onTextTrackRemoveCue(arg_textTrackUid!, arg_cueUid!);
          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.THEOplayerFlutterTextTracksAPI.onTextTrackEnterCue', 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.THEOplayerFlutterTextTracksAPI.onTextTrackEnterCue was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_textTrackUid = (args[0] as int?);
        assert(arg_textTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackEnterCue was null, expected non-null int.');
        final int? arg_cueUid = (args[1] as int?);
        assert(arg_cueUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackEnterCue was null, expected non-null int.');
        try {
          api.onTextTrackEnterCue(arg_textTrackUid!, arg_cueUid!);
          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.THEOplayerFlutterTextTracksAPI.onTextTrackExitCue', 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.THEOplayerFlutterTextTracksAPI.onTextTrackExitCue was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_textTrackUid = (args[0] as int?);
        assert(arg_textTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackExitCue was null, expected non-null int.');
        final int? arg_cueUid = (args[1] as int?);
        assert(arg_cueUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackExitCue was null, expected non-null int.');
        try {
          api.onTextTrackExitCue(arg_textTrackUid!, arg_cueUid!);
          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.THEOplayerFlutterTextTracksAPI.onTextTrackCueChange', 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.THEOplayerFlutterTextTracksAPI.onTextTrackCueChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_textTrackUid = (args[0] as int?);
        assert(arg_textTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackCueChange was null, expected non-null int.');
        try {
          api.onTextTrackCueChange(arg_textTrackUid!);
          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.THEOplayerFlutterTextTracksAPI.onTextTrackChange', 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.THEOplayerFlutterTextTracksAPI.onTextTrackChange was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_textTrackUid = (args[0] as int?);
        assert(arg_textTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onTextTrackChange was null, expected non-null int.');
        try {
          api.onTextTrackChange(arg_textTrackUid!);
          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.THEOplayerFlutterTextTracksAPI.onCueEnter', 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.THEOplayerFlutterTextTracksAPI.onCueEnter was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_textTrackUid = (args[0] as int?);
        assert(arg_textTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onCueEnter was null, expected non-null int.');
        final int? arg_cueUid = (args[1] as int?);
        assert(arg_cueUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onCueEnter was null, expected non-null int.');
        try {
          api.onCueEnter(arg_textTrackUid!, arg_cueUid!);
          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.THEOplayerFlutterTextTracksAPI.onCueExit', 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.THEOplayerFlutterTextTracksAPI.onCueExit was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_textTrackUid = (args[0] as int?);
        assert(arg_textTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onCueExit was null, expected non-null int.');
        final int? arg_cueUid = (args[1] as int?);
        assert(arg_cueUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onCueExit was null, expected non-null int.');
        try {
          api.onCueExit(arg_textTrackUid!, arg_cueUid!);
          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.THEOplayerFlutterTextTracksAPI.onCueUpdate', 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.THEOplayerFlutterTextTracksAPI.onCueUpdate was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final int? arg_textTrackUid = (args[0] as int?);
        assert(arg_textTrackUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onCueUpdate was null, expected non-null int.');
        final int? arg_cueUid = (args[1] as int?);
        assert(arg_cueUid != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onCueUpdate was null, expected non-null int.');
        final double? arg_endTime = (args[2] as double?);
        assert(arg_endTime != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onCueUpdate was null, expected non-null double.');
        final String? arg_content = (args[3] as String?);
        assert(arg_content != null,
            'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterTextTracksAPI.onCueUpdate was null, expected non-null String.');
        try {
          api.onCueUpdate(arg_textTrackUid!, arg_cueUid!, arg_endTime!, arg_content!);
          return wrapResponse(empty: true);
        } on PlatformException catch (e) {
          return wrapResponse(error: e);
        }          catch (e) {
          return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
        }
      });
    }
  }
}