Implementation
static void setup(THEOplayerFlutterAPI? api, {BinaryMessenger? binaryMessenger}) {
{
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onSourceChange', 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.THEOplayerFlutterAPI.onSourceChange was null.');
final List<Object?> args = (message as List<Object?>?)!;
final SourceDescription? arg_source = (args[0] as SourceDescription?);
try {
api.onSourceChange(arg_source);
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.THEOplayerFlutterAPI.onPlay', 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.THEOplayerFlutterAPI.onPlay was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onPlay was null, expected non-null double.');
try {
api.onPlay(arg_currentTime!);
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.THEOplayerFlutterAPI.onPlaying', 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.THEOplayerFlutterAPI.onPlaying was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onPlaying was null, expected non-null double.');
try {
api.onPlaying(arg_currentTime!);
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.THEOplayerFlutterAPI.onPause', 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.THEOplayerFlutterAPI.onPause was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onPause was null, expected non-null double.');
try {
api.onPause(arg_currentTime!);
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.THEOplayerFlutterAPI.onWaiting', 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.THEOplayerFlutterAPI.onWaiting was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onWaiting was null, expected non-null double.');
try {
api.onWaiting(arg_currentTime!);
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.THEOplayerFlutterAPI.onDurationChange', 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.THEOplayerFlutterAPI.onDurationChange was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_duration = (args[0] as double?);
assert(arg_duration != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onDurationChange was null, expected non-null double.');
try {
api.onDurationChange(arg_duration!);
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.THEOplayerFlutterAPI.onProgress', 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.THEOplayerFlutterAPI.onProgress was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onProgress was null, expected non-null double.');
try {
api.onProgress(arg_currentTime!);
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.THEOplayerFlutterAPI.onTimeUpdate', 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.THEOplayerFlutterAPI.onTimeUpdate was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onTimeUpdate was null, expected non-null double.');
final int? arg_currentProgramDateTime = (args[1] as int?);
try {
api.onTimeUpdate(arg_currentTime!, arg_currentProgramDateTime);
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.THEOplayerFlutterAPI.onRateChange', 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.THEOplayerFlutterAPI.onRateChange was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onRateChange was null, expected non-null double.');
final double? arg_playbackRate = (args[1] as double?);
assert(arg_playbackRate != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onRateChange was null, expected non-null double.');
try {
api.onRateChange(arg_currentTime!, arg_playbackRate!);
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.THEOplayerFlutterAPI.onSeeking', 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.THEOplayerFlutterAPI.onSeeking was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onSeeking was null, expected non-null double.');
try {
api.onSeeking(arg_currentTime!);
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.THEOplayerFlutterAPI.onSeeked', 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.THEOplayerFlutterAPI.onSeeked was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onSeeked was null, expected non-null double.');
try {
api.onSeeked(arg_currentTime!);
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.THEOplayerFlutterAPI.onVolumeChange', 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.THEOplayerFlutterAPI.onVolumeChange was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onVolumeChange was null, expected non-null double.');
final double? arg_volume = (args[1] as double?);
assert(arg_volume != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onVolumeChange was null, expected non-null double.');
try {
api.onVolumeChange(arg_currentTime!, arg_volume!);
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.THEOplayerFlutterAPI.onResize', 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.THEOplayerFlutterAPI.onResize was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onResize was null, expected non-null double.');
final int? arg_width = (args[1] as int?);
assert(arg_width != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onResize was null, expected non-null int.');
final int? arg_height = (args[2] as int?);
assert(arg_height != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onResize was null, expected non-null int.');
try {
api.onResize(arg_currentTime!, arg_width!, arg_height!);
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.THEOplayerFlutterAPI.onEnded', 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.THEOplayerFlutterAPI.onEnded was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onEnded was null, expected non-null double.');
try {
api.onEnded(arg_currentTime!);
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.THEOplayerFlutterAPI.onError', 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.THEOplayerFlutterAPI.onError was null.');
final List<Object?> args = (message as List<Object?>?)!;
final String? arg_error = (args[0] as String?);
assert(arg_error != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onError was null, expected non-null String.');
try {
api.onError(arg_error!);
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.THEOplayerFlutterAPI.onDestroy', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
channel.setMessageHandler(null);
} else {
channel.setMessageHandler((Object? message) async {
try {
api.onDestroy();
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.THEOplayerFlutterAPI.onReadyStateChange', 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.THEOplayerFlutterAPI.onReadyStateChange was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onReadyStateChange was null, expected non-null double.');
final ReadyState? arg_readyState = args[1] == null ? null : ReadyState.values[args[1]! as int];
assert(arg_readyState != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onReadyStateChange was null, expected non-null ReadyState.');
try {
api.onReadyStateChange(arg_currentTime!, arg_readyState!);
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.THEOplayerFlutterAPI.onLoadStart', codec,
binaryMessenger: binaryMessenger);
if (api == null) {
channel.setMessageHandler(null);
} else {
channel.setMessageHandler((Object? message) async {
try {
api.onLoadStart();
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.THEOplayerFlutterAPI.onLoadedMetadata', 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.THEOplayerFlutterAPI.onLoadedMetadata was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onLoadedMetadata was null, expected non-null double.');
try {
api.onLoadedMetadata(arg_currentTime!);
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.THEOplayerFlutterAPI.onLoadedData', 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.THEOplayerFlutterAPI.onLoadedData was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onLoadedData was null, expected non-null double.');
try {
api.onLoadedData(arg_currentTime!);
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.THEOplayerFlutterAPI.onCanPlay', 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.THEOplayerFlutterAPI.onCanPlay was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onCanPlay was null, expected non-null double.');
try {
api.onCanPlay(arg_currentTime!);
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.THEOplayerFlutterAPI.onCanPlayThrough', 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.THEOplayerFlutterAPI.onCanPlayThrough was null.');
final List<Object?> args = (message as List<Object?>?)!;
final double? arg_currentTime = (args[0] as double?);
assert(arg_currentTime != null,
'Argument for dev.flutter.pigeon.theoplayer_platform_interface.THEOplayerFlutterAPI.onCanPlayThrough was null, expected non-null double.');
try {
api.onCanPlayThrough(arg_currentTime!);
return wrapResponse(empty: true);
} on PlatformException catch (e) {
return wrapResponse(error: e);
} catch (e) {
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
}
});
}
}
}