[video_player] Rename internal method channels (#5045)

diff --git a/packages/video_player/video_player_android/CHANGELOG.md b/packages/video_player/video_player_android/CHANGELOG.md
index ec526ee..774589c 100644
--- a/packages/video_player/video_player_android/CHANGELOG.md
+++ b/packages/video_player/video_player_android/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 2.3.1
+
+* Renames internal method channels to avoid potential confusion with the
+  default implementation's method channel.
+* Updates Pigeon to 2.0.1.
+
 ## 2.3.0
 
 * Updates Pigeon to ^1.0.16.
diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java
index 0cdf356..6593ebf 100644
--- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java
+++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/Messages.java
@@ -1,7 +1,7 @@
 // Copyright 2013 The Flutter Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
-// Autogenerated from Pigeon (v1.0.16), do not edit directly.
+// Autogenerated from Pigeon (v2.0.1), do not edit directly.
 // See also: https://pub.dev/packages/pigeon
 
 package io.flutter.plugins.videoplayer;
@@ -557,10 +557,10 @@
     }
   }
 
-  private static class VideoPlayerApiCodec extends StandardMessageCodec {
-    public static final VideoPlayerApiCodec INSTANCE = new VideoPlayerApiCodec();
+  private static class AndroidVideoPlayerApiCodec extends StandardMessageCodec {
+    public static final AndroidVideoPlayerApiCodec INSTANCE = new AndroidVideoPlayerApiCodec();
 
-    private VideoPlayerApiCodec() {}
+    private AndroidVideoPlayerApiCodec() {}
 
     @Override
     protected Object readValueOfType(byte type, ByteBuffer buffer) {
@@ -621,40 +621,45 @@
   }
 
   /** Generated interface from Pigeon that represents a handler of messages from Flutter. */
-  public interface VideoPlayerApi {
+  public interface AndroidVideoPlayerApi {
     void initialize();
 
-    TextureMessage create(CreateMessage msg);
+    @NonNull
+    TextureMessage create(@NonNull CreateMessage msg);
 
-    void dispose(TextureMessage msg);
+    void dispose(@NonNull TextureMessage msg);
 
-    void setLooping(LoopingMessage msg);
+    void setLooping(@NonNull LoopingMessage msg);
 
-    void setVolume(VolumeMessage msg);
+    void setVolume(@NonNull VolumeMessage msg);
 
-    void setPlaybackSpeed(PlaybackSpeedMessage msg);
+    void setPlaybackSpeed(@NonNull PlaybackSpeedMessage msg);
 
-    void play(TextureMessage msg);
+    void play(@NonNull TextureMessage msg);
 
-    PositionMessage position(TextureMessage msg);
+    @NonNull
+    PositionMessage position(@NonNull TextureMessage msg);
 
-    void seekTo(PositionMessage msg);
+    void seekTo(@NonNull PositionMessage msg);
 
-    void pause(TextureMessage msg);
+    void pause(@NonNull TextureMessage msg);
 
-    void setMixWithOthers(MixWithOthersMessage msg);
+    void setMixWithOthers(@NonNull MixWithOthersMessage msg);
 
-    /** The codec used by VideoPlayerApi. */
+    /** The codec used by AndroidVideoPlayerApi. */
     static MessageCodec<Object> getCodec() {
-      return VideoPlayerApiCodec.INSTANCE;
+      return AndroidVideoPlayerApiCodec.INSTANCE;
     }
 
-    /** Sets up an instance of `VideoPlayerApi` to handle messages through the `binaryMessenger`. */
-    static void setup(BinaryMessenger binaryMessenger, VideoPlayerApi api) {
+    /**
+     * Sets up an instance of `AndroidVideoPlayerApi` to handle messages through the
+     * `binaryMessenger`.
+     */
+    static void setup(BinaryMessenger binaryMessenger, AndroidVideoPlayerApi api) {
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.initialize", getCodec());
+                binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.initialize", getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
@@ -674,7 +679,7 @@
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.create", getCodec());
+                binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.create", getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
@@ -699,7 +704,7 @@
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.dispose", getCodec());
+                binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.dispose", getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
@@ -724,7 +729,7 @@
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.setLooping", getCodec());
+                binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping", getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
@@ -749,7 +754,7 @@
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.setVolume", getCodec());
+                binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume", getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
@@ -774,7 +779,9 @@
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed", getCodec());
+                binaryMessenger,
+                "dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed",
+                getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
@@ -799,7 +806,7 @@
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.play", getCodec());
+                binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.play", getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
@@ -824,7 +831,7 @@
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.position", getCodec());
+                binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.position", getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
@@ -849,7 +856,7 @@
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.seekTo", getCodec());
+                binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo", getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
@@ -874,7 +881,7 @@
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.pause", getCodec());
+                binaryMessenger, "dev.flutter.pigeon.AndroidVideoPlayerApi.pause", getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
@@ -899,7 +906,9 @@
       {
         BasicMessageChannel<Object> channel =
             new BasicMessageChannel<>(
-                binaryMessenger, "dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers", getCodec());
+                binaryMessenger,
+                "dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers",
+                getCodec());
         if (api != null) {
           channel.setMessageHandler(
               (message, reply) -> {
diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java
index 168d90d..56fabec 100644
--- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java
+++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java
@@ -12,13 +12,13 @@
 import io.flutter.embedding.engine.plugins.FlutterPlugin;
 import io.flutter.plugin.common.BinaryMessenger;
 import io.flutter.plugin.common.EventChannel;
+import io.flutter.plugins.videoplayer.Messages.AndroidVideoPlayerApi;
 import io.flutter.plugins.videoplayer.Messages.CreateMessage;
 import io.flutter.plugins.videoplayer.Messages.LoopingMessage;
 import io.flutter.plugins.videoplayer.Messages.MixWithOthersMessage;
 import io.flutter.plugins.videoplayer.Messages.PlaybackSpeedMessage;
 import io.flutter.plugins.videoplayer.Messages.PositionMessage;
 import io.flutter.plugins.videoplayer.Messages.TextureMessage;
-import io.flutter.plugins.videoplayer.Messages.VideoPlayerApi;
 import io.flutter.plugins.videoplayer.Messages.VolumeMessage;
 import io.flutter.view.TextureRegistry;
 import java.security.KeyManagementException;
@@ -27,7 +27,7 @@
 import javax.net.ssl.HttpsURLConnection;
 
 /** Android platform implementation of the VideoPlayerPlugin. */
-public class VideoPlayerPlugin implements FlutterPlugin, VideoPlayerApi {
+public class VideoPlayerPlugin implements FlutterPlugin, AndroidVideoPlayerApi {
   private static final String TAG = "VideoPlayerPlugin";
   private final LongSparseArray<VideoPlayer> videoPlayers = new LongSparseArray<>();
   private FlutterState flutterState;
@@ -61,7 +61,6 @@
 
   @Override
   public void onAttachedToEngine(FlutterPluginBinding binding) {
-
     if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
       try {
         HttpsURLConnection.setDefaultSSLSocketFactory(new CustomSSLSocketFactory());
@@ -241,11 +240,11 @@
     }
 
     void startListening(VideoPlayerPlugin methodCallHandler, BinaryMessenger messenger) {
-      VideoPlayerApi.setup(messenger, methodCallHandler);
+      AndroidVideoPlayerApi.setup(messenger, methodCallHandler);
     }
 
     void stopListening(BinaryMessenger messenger) {
-      VideoPlayerApi.setup(messenger, null);
+      AndroidVideoPlayerApi.setup(messenger, null);
     }
   }
 }
diff --git a/packages/video_player/video_player_android/lib/src/android_video_player.dart b/packages/video_player/video_player_android/lib/src/android_video_player.dart
index d713b28..31d0744 100644
--- a/packages/video_player/video_player_android/lib/src/android_video_player.dart
+++ b/packages/video_player/video_player_android/lib/src/android_video_player.dart
@@ -14,7 +14,7 @@
 /// An Android implementation of [VideoPlayerPlatform] that uses the
 /// Pigeon-generated [VideoPlayerApi].
 class AndroidVideoPlayer extends VideoPlayerPlatform {
-  final VideoPlayerApi _api = VideoPlayerApi();
+  final AndroidVideoPlayerApi _api = AndroidVideoPlayerApi();
 
   /// Registers this class as the default instance of [PathProviderPlatform].
   static void registerWith() {
diff --git a/packages/video_player/video_player_android/lib/src/messages.g.dart b/packages/video_player/video_player_android/lib/src/messages.g.dart
index 5fa09e3..0dadd2e 100644
--- a/packages/video_player/video_player_android/lib/src/messages.g.dart
+++ b/packages/video_player/video_player_android/lib/src/messages.g.dart
@@ -1,7 +1,7 @@
 // Copyright 2013 The Flutter Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
-// Autogenerated from Pigeon (v1.0.16), do not edit directly.
+// Autogenerated from Pigeon (v2.0.1), do not edit directly.
 // See also: https://pub.dev/packages/pigeon
 // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name
 // @dart = 2.12
@@ -191,8 +191,8 @@
   }
 }
 
-class _VideoPlayerApiCodec extends StandardMessageCodec {
-  const _VideoPlayerApiCodec();
+class _AndroidVideoPlayerApiCodec extends StandardMessageCodec {
+  const _AndroidVideoPlayerApiCodec();
   @override
   void writeValue(WriteBuffer buffer, Object? value) {
     if (value is CreateMessage) {
@@ -251,20 +251,20 @@
   }
 }
 
-class VideoPlayerApi {
-  /// Constructor for [VideoPlayerApi].  The [binaryMessenger] named argument is
+class AndroidVideoPlayerApi {
+  /// Constructor for [AndroidVideoPlayerApi].  The [binaryMessenger] named argument is
   /// available for dependency injection.  If it is left null, the default
   /// BinaryMessenger will be used which routes to the host platform.
-  VideoPlayerApi({BinaryMessenger? binaryMessenger})
+  AndroidVideoPlayerApi({BinaryMessenger? binaryMessenger})
       : _binaryMessenger = binaryMessenger;
 
   final BinaryMessenger? _binaryMessenger;
 
-  static const MessageCodec<Object?> codec = _VideoPlayerApiCodec();
+  static const MessageCodec<Object?> codec = _AndroidVideoPlayerApiCodec();
 
   Future<void> initialize() async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.initialize', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.initialize', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
         await channel.send(null) as Map<Object?, Object?>?;
@@ -272,7 +272,6 @@
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -289,15 +288,14 @@
 
   Future<TextureMessage> create(CreateMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.create', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.create', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -307,6 +305,11 @@
         message: error['message'] as String?,
         details: error['details'],
       );
+    } else if (replyMap['result'] == null) {
+      throw PlatformException(
+        code: 'null-error',
+        message: 'Host platform returned null value for non-null return value.',
+      );
     } else {
       return (replyMap['result'] as TextureMessage?)!;
     }
@@ -314,15 +317,14 @@
 
   Future<void> dispose(TextureMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.dispose', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.dispose', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -339,15 +341,14 @@
 
   Future<void> setLooping(LoopingMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.setLooping', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -364,15 +365,14 @@
 
   Future<void> setVolume(VolumeMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.setVolume', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -389,15 +389,14 @@
 
   Future<void> setPlaybackSpeed(PlaybackSpeedMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -414,15 +413,14 @@
 
   Future<void> play(TextureMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.play', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.play', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -439,15 +437,14 @@
 
   Future<PositionMessage> position(TextureMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.position', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.position', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -457,6 +454,11 @@
         message: error['message'] as String?,
         details: error['details'],
       );
+    } else if (replyMap['result'] == null) {
+      throw PlatformException(
+        code: 'null-error',
+        message: 'Host platform returned null value for non-null return value.',
+      );
     } else {
       return (replyMap['result'] as PositionMessage?)!;
     }
@@ -464,15 +466,14 @@
 
   Future<void> seekTo(PositionMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.seekTo', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -489,15 +490,14 @@
 
   Future<void> pause(TextureMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.pause', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.pause', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -514,15 +514,14 @@
 
   Future<void> setMixWithOthers(MixWithOthersMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers', codec,
+        'dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
diff --git a/packages/video_player/video_player_android/pigeons/messages.dart b/packages/video_player/video_player_android/pigeons/messages.dart
index 9efbfc9..bf552f9 100644
--- a/packages/video_player/video_player_android/pigeons/messages.dart
+++ b/packages/video_player/video_player_android/pigeons/messages.dart
@@ -57,7 +57,7 @@
 }
 
 @HostApi(dartHostTestHandler: 'TestHostVideoPlayerApi')
-abstract class VideoPlayerApi {
+abstract class AndroidVideoPlayerApi {
   void initialize();
   TextureMessage create(CreateMessage msg);
   void dispose(TextureMessage msg);
diff --git a/packages/video_player/video_player_android/pubspec.yaml b/packages/video_player/video_player_android/pubspec.yaml
index c40d518..15c063f 100644
--- a/packages/video_player/video_player_android/pubspec.yaml
+++ b/packages/video_player/video_player_android/pubspec.yaml
@@ -2,7 +2,7 @@
 description: Android implementation of the video_player plugin.
 repository: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_android
 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
-version: 2.3.0
+version: 2.3.1
 
 environment:
   sdk: ">=2.14.0 <3.0.0"
@@ -25,4 +25,4 @@
 dev_dependencies:
   flutter_test:
     sdk: flutter
-  pigeon: ^1.0.16
+  pigeon: ^2.0.1
diff --git a/packages/video_player/video_player_android/test/test_api.dart b/packages/video_player/video_player_android/test/test_api.dart
index e8bc9d8..c0ff23d 100644
--- a/packages/video_player/video_player_android/test/test_api.dart
+++ b/packages/video_player/video_player_android/test/test_api.dart
@@ -1,9 +1,10 @@
 // Copyright 2013 The Flutter Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
-// Autogenerated from Pigeon (v1.0.16), do not edit directly.
+// Autogenerated from Pigeon (v2.0.1), do not edit directly.
 // See also: https://pub.dev/packages/pigeon
 // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis
+// ignore_for_file: avoid_relative_lib_imports
 // @dart = 2.12
 import 'dart:async';
 import 'dart:typed_data' show Uint8List, Int32List, Int64List, Float64List;
@@ -92,7 +93,7 @@
       {BinaryMessenger? binaryMessenger}) {
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.initialize', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.initialize', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
@@ -106,18 +107,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.create', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.create', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.create was null.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.create was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final CreateMessage? arg_msg = (args[0] as CreateMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.create was null, expected non-null CreateMessage.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.create was null, expected non-null CreateMessage.');
           final TextureMessage output = api.create(arg_msg!);
           return <Object?, Object?>{'result': output};
         });
@@ -125,18 +126,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.dispose', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.dispose', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.dispose was null.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.dispose was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final TextureMessage? arg_msg = (args[0] as TextureMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.dispose was null, expected non-null TextureMessage.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.dispose was null, expected non-null TextureMessage.');
           api.dispose(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -144,18 +145,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.setLooping', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setLooping was null.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final LoopingMessage? arg_msg = (args[0] as LoopingMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setLooping was null, expected non-null LoopingMessage.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setLooping was null, expected non-null LoopingMessage.');
           api.setLooping(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -163,18 +164,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.setVolume', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setVolume was null.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final VolumeMessage? arg_msg = (args[0] as VolumeMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setVolume was null, expected non-null VolumeMessage.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setVolume was null, expected non-null VolumeMessage.');
           api.setVolume(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -182,19 +183,19 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed was null.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final PlaybackSpeedMessage? arg_msg =
               (args[0] as PlaybackSpeedMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed was null, expected non-null PlaybackSpeedMessage.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setPlaybackSpeed was null, expected non-null PlaybackSpeedMessage.');
           api.setPlaybackSpeed(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -202,18 +203,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.play', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.play', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.play was null.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.play was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final TextureMessage? arg_msg = (args[0] as TextureMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.play was null, expected non-null TextureMessage.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.play was null, expected non-null TextureMessage.');
           api.play(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -221,18 +222,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.position', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.position', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.position was null.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.position was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final TextureMessage? arg_msg = (args[0] as TextureMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.position was null, expected non-null TextureMessage.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.position was null, expected non-null TextureMessage.');
           final PositionMessage output = api.position(arg_msg!);
           return <Object?, Object?>{'result': output};
         });
@@ -240,18 +241,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.seekTo', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.seekTo was null.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final PositionMessage? arg_msg = (args[0] as PositionMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.seekTo was null, expected non-null PositionMessage.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.seekTo was null, expected non-null PositionMessage.');
           api.seekTo(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -259,18 +260,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.pause', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.pause', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.pause was null.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.pause was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final TextureMessage? arg_msg = (args[0] as TextureMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.pause was null, expected non-null TextureMessage.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.pause was null, expected non-null TextureMessage.');
           api.pause(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -278,19 +279,19 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers', codec,
+          'dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers was null.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final MixWithOthersMessage? arg_msg =
               (args[0] as MixWithOthersMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers was null, expected non-null MixWithOthersMessage.');
+              'Argument for dev.flutter.pigeon.AndroidVideoPlayerApi.setMixWithOthers was null, expected non-null MixWithOthersMessage.');
           api.setMixWithOthers(arg_msg!);
           return <Object?, Object?>{};
         });
diff --git a/packages/video_player/video_player_avfoundation/CHANGELOG.md b/packages/video_player/video_player_avfoundation/CHANGELOG.md
index d6ecabd..c36c987 100644
--- a/packages/video_player/video_player_avfoundation/CHANGELOG.md
+++ b/packages/video_player/video_player_avfoundation/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 2.3.1
+
+* Renames internal method channels to avoid potential confusion with the
+  default implementation's method channel.
+* Updates Pigeon to 2.0.1.
+
 ## 2.3.0
 
 * Updates Pigeon to ^1.0.16.
diff --git a/packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m b/packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m
index 6d8b396..cbf2866 100644
--- a/packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m
+++ b/packages/video_player/video_player_avfoundation/example/ios/RunnerTests/VideoPlayerTests.m
@@ -12,7 +12,7 @@
 @property(readonly, nonatomic) AVPlayer *player;
 @end
 
-@interface FLTVideoPlayerPlugin (Test) <FLTVideoPlayerApi>
+@interface FLTVideoPlayerPlugin (Test) <FLTAVFoundationVideoPlayerApi>
 @property(readonly, strong, nonatomic)
     NSMutableDictionary<NSNumber *, FLTVideoPlayer *> *playersByTextureId;
 @end
diff --git a/packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m b/packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m
index 026b576..2fb9f7f 100644
--- a/packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m
+++ b/packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m
@@ -499,7 +499,7 @@
 
 @end
 
-@interface FLTVideoPlayerPlugin () <FLTVideoPlayerApi>
+@interface FLTVideoPlayerPlugin () <FLTAVFoundationVideoPlayerApi>
 @property(readonly, weak, nonatomic) NSObject<FlutterTextureRegistry> *registry;
 @property(readonly, weak, nonatomic) NSObject<FlutterBinaryMessenger> *messenger;
 @property(readonly, strong, nonatomic)
@@ -511,7 +511,7 @@
 + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
   FLTVideoPlayerPlugin *instance = [[FLTVideoPlayerPlugin alloc] initWithRegistrar:registrar];
   [registrar publish:instance];
-  FLTVideoPlayerApiSetup(registrar.messenger, instance);
+  FLTAVFoundationVideoPlayerApiSetup(registrar.messenger, instance);
 }
 
 - (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
@@ -530,7 +530,7 @@
   // TODO(57151): This should be commented out when 57151's fix lands on stable.
   // This is the correct behavior we never did it in the past and the engine
   // doesn't currently support it.
-  // FLTVideoPlayerApiSetup(registrar.messenger, nil);
+  // FLTAVFoundationVideoPlayerApiSetup(registrar.messenger, nil);
 }
 
 - (FLTTextureMessage *)onPlayerSetup:(FLTVideoPlayer *)player
diff --git a/packages/video_player/video_player_avfoundation/ios/Classes/messages.g.h b/packages/video_player/video_player_avfoundation/ios/Classes/messages.g.h
index 96d02d2..130d484 100644
--- a/packages/video_player/video_player_avfoundation/ios/Classes/messages.g.h
+++ b/packages/video_player/video_player_avfoundation/ios/Classes/messages.g.h
@@ -1,7 +1,7 @@
 // Copyright 2013 The Flutter Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
-// Autogenerated from Pigeon (v1.0.17), do not edit directly.
+// Autogenerated from Pigeon (v2.0.1), do not edit directly.
 // See also: https://pub.dev/packages/pigeon
 #import <Foundation/Foundation.h>
 @protocol FlutterBinaryMessenger;
@@ -80,11 +80,12 @@
 @property(nonatomic, strong) NSNumber *mixWithOthers;
 @end
 
-/// The codec used by FLTVideoPlayerApi.
-NSObject<FlutterMessageCodec> *FLTVideoPlayerApiGetCodec(void);
+/// The codec used by FLTAVFoundationVideoPlayerApi.
+NSObject<FlutterMessageCodec> *FLTAVFoundationVideoPlayerApiGetCodec(void);
 
-@protocol FLTVideoPlayerApi
+@protocol FLTAVFoundationVideoPlayerApi
 - (void)initialize:(FlutterError *_Nullable *_Nonnull)error;
+/// @return `nil` only when `error != nil`.
 - (nullable FLTTextureMessage *)create:(FLTCreateMessage *)msg
                                  error:(FlutterError *_Nullable *_Nonnull)error;
 - (void)dispose:(FLTTextureMessage *)msg error:(FlutterError *_Nullable *_Nonnull)error;
@@ -93,6 +94,7 @@
 - (void)setPlaybackSpeed:(FLTPlaybackSpeedMessage *)msg
                    error:(FlutterError *_Nullable *_Nonnull)error;
 - (void)play:(FLTTextureMessage *)msg error:(FlutterError *_Nullable *_Nonnull)error;
+/// @return `nil` only when `error != nil`.
 - (nullable FLTPositionMessage *)position:(FLTTextureMessage *)msg
                                     error:(FlutterError *_Nullable *_Nonnull)error;
 - (void)seekTo:(FLTPositionMessage *)msg error:(FlutterError *_Nullable *_Nonnull)error;
@@ -101,7 +103,8 @@
                    error:(FlutterError *_Nullable *_Nonnull)error;
 @end
 
-extern void FLTVideoPlayerApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
-                                   NSObject<FLTVideoPlayerApi> *_Nullable api);
+extern void FLTAVFoundationVideoPlayerApiSetup(
+    id<FlutterBinaryMessenger> binaryMessenger,
+    NSObject<FLTAVFoundationVideoPlayerApi> *_Nullable api);
 
 NS_ASSUME_NONNULL_END
diff --git a/packages/video_player/video_player_avfoundation/ios/Classes/messages.g.m b/packages/video_player/video_player_avfoundation/ios/Classes/messages.g.m
index c9acee4..d82dc38 100644
--- a/packages/video_player/video_player_avfoundation/ios/Classes/messages.g.m
+++ b/packages/video_player/video_player_avfoundation/ios/Classes/messages.g.m
@@ -1,7 +1,7 @@
 // Copyright 2013 The Flutter Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
-// Autogenerated from Pigeon (v1.0.17), do not edit directly.
+// Autogenerated from Pigeon (v2.0.1), do not edit directly.
 // See also: https://pub.dev/packages/pigeon
 #import "messages.g.h"
 #import <Flutter/Flutter.h>
@@ -28,6 +28,10 @@
   id result = dict[key];
   return (result == [NSNull null]) ? nil : result;
 }
+static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
+  id result = array[key];
+  return (result == [NSNull null]) ? nil : result;
+}
 
 @interface FLTTextureMessage ()
 + (FLTTextureMessage *)fromMap:(NSDictionary *)dict;
@@ -223,9 +227,9 @@
 }
 @end
 
-@interface FLTVideoPlayerApiCodecReader : FlutterStandardReader
+@interface FLTAVFoundationVideoPlayerApiCodecReader : FlutterStandardReader
 @end
-@implementation FLTVideoPlayerApiCodecReader
+@implementation FLTAVFoundationVideoPlayerApiCodecReader
 - (nullable id)readValueOfType:(UInt8)type {
   switch (type) {
     case 128:
@@ -255,9 +259,9 @@
 }
 @end
 
-@interface FLTVideoPlayerApiCodecWriter : FlutterStandardWriter
+@interface FLTAVFoundationVideoPlayerApiCodecWriter : FlutterStandardWriter
 @end
-@implementation FLTVideoPlayerApiCodecWriter
+@implementation FLTAVFoundationVideoPlayerApiCodecWriter
 - (void)writeValue:(id)value {
   if ([value isKindOfClass:[FLTCreateMessage class]]) {
     [self writeByte:128];
@@ -286,38 +290,39 @@
 }
 @end
 
-@interface FLTVideoPlayerApiCodecReaderWriter : FlutterStandardReaderWriter
+@interface FLTAVFoundationVideoPlayerApiCodecReaderWriter : FlutterStandardReaderWriter
 @end
-@implementation FLTVideoPlayerApiCodecReaderWriter
+@implementation FLTAVFoundationVideoPlayerApiCodecReaderWriter
 - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data {
-  return [[FLTVideoPlayerApiCodecWriter alloc] initWithData:data];
+  return [[FLTAVFoundationVideoPlayerApiCodecWriter alloc] initWithData:data];
 }
 - (FlutterStandardReader *)readerWithData:(NSData *)data {
-  return [[FLTVideoPlayerApiCodecReader alloc] initWithData:data];
+  return [[FLTAVFoundationVideoPlayerApiCodecReader alloc] initWithData:data];
 }
 @end
 
-NSObject<FlutterMessageCodec> *FLTVideoPlayerApiGetCodec() {
+NSObject<FlutterMessageCodec> *FLTAVFoundationVideoPlayerApiGetCodec() {
   static dispatch_once_t sPred = 0;
   static FlutterStandardMessageCodec *sSharedObject = nil;
   dispatch_once(&sPred, ^{
-    FLTVideoPlayerApiCodecReaderWriter *readerWriter =
-        [[FLTVideoPlayerApiCodecReaderWriter alloc] init];
+    FLTAVFoundationVideoPlayerApiCodecReaderWriter *readerWriter =
+        [[FLTAVFoundationVideoPlayerApiCodecReaderWriter alloc] init];
     sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter];
   });
   return sSharedObject;
 }
 
-void FLTVideoPlayerApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
-                            NSObject<FLTVideoPlayerApi> *api) {
+void FLTAVFoundationVideoPlayerApiSetup(id<FlutterBinaryMessenger> binaryMessenger,
+                                        NSObject<FLTAVFoundationVideoPlayerApi> *api) {
   {
-    FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel
-        messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.initialize"
-               binaryMessenger:binaryMessenger
-                         codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.initialize"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
       NSCAssert([api respondsToSelector:@selector(initialize:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(initialize:)", api);
+                @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(initialize:)",
+                api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         FlutterError *error;
         [api initialize:&error];
@@ -328,16 +333,18 @@
     }
   }
   {
-    FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel
-        messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.create"
-               binaryMessenger:binaryMessenger
-                         codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.create"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
-      NSCAssert([api respondsToSelector:@selector(create:error:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(create:error:)", api);
+      NSCAssert(
+          [api respondsToSelector:@selector(create:error:)],
+          @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(create:error:)",
+          api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         NSArray *args = message;
-        FLTCreateMessage *arg_msg = args[0];
+        FLTCreateMessage *arg_msg = GetNullableObjectAtIndex(args, 0);
         FlutterError *error;
         FLTTextureMessage *output = [api create:arg_msg error:&error];
         callback(wrapResult(output, error));
@@ -347,16 +354,18 @@
     }
   }
   {
-    FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel
-        messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.dispose"
-               binaryMessenger:binaryMessenger
-                         codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.dispose"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
-      NSCAssert([api respondsToSelector:@selector(dispose:error:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(dispose:error:)", api);
+      NSCAssert(
+          [api respondsToSelector:@selector(dispose:error:)],
+          @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(dispose:error:)",
+          api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         NSArray *args = message;
-        FLTTextureMessage *arg_msg = args[0];
+        FLTTextureMessage *arg_msg = GetNullableObjectAtIndex(args, 0);
         FlutterError *error;
         [api dispose:arg_msg error:&error];
         callback(wrapResult(nil, error));
@@ -366,16 +375,18 @@
     }
   }
   {
-    FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel
-        messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.setLooping"
-               binaryMessenger:binaryMessenger
-                         codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.setLooping"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
-      NSCAssert([api respondsToSelector:@selector(setLooping:error:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(setLooping:error:)", api);
+      NSCAssert(
+          [api respondsToSelector:@selector(setLooping:error:)],
+          @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(setLooping:error:)",
+          api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         NSArray *args = message;
-        FLTLoopingMessage *arg_msg = args[0];
+        FLTLoopingMessage *arg_msg = GetNullableObjectAtIndex(args, 0);
         FlutterError *error;
         [api setLooping:arg_msg error:&error];
         callback(wrapResult(nil, error));
@@ -385,16 +396,18 @@
     }
   }
   {
-    FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel
-        messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.setVolume"
-               binaryMessenger:binaryMessenger
-                         codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.setVolume"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
-      NSCAssert([api respondsToSelector:@selector(setVolume:error:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(setVolume:error:)", api);
+      NSCAssert(
+          [api respondsToSelector:@selector(setVolume:error:)],
+          @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(setVolume:error:)",
+          api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         NSArray *args = message;
-        FLTVolumeMessage *arg_msg = args[0];
+        FLTVolumeMessage *arg_msg = GetNullableObjectAtIndex(args, 0);
         FlutterError *error;
         [api setVolume:arg_msg error:&error];
         callback(wrapResult(nil, error));
@@ -404,17 +417,18 @@
     }
   }
   {
-    FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel
-        messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed"
-               binaryMessenger:binaryMessenger
-                         codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.setPlaybackSpeed"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
       NSCAssert([api respondsToSelector:@selector(setPlaybackSpeed:error:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(setPlaybackSpeed:error:)",
+                @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to "
+                @"@selector(setPlaybackSpeed:error:)",
                 api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         NSArray *args = message;
-        FLTPlaybackSpeedMessage *arg_msg = args[0];
+        FLTPlaybackSpeedMessage *arg_msg = GetNullableObjectAtIndex(args, 0);
         FlutterError *error;
         [api setPlaybackSpeed:arg_msg error:&error];
         callback(wrapResult(nil, error));
@@ -424,16 +438,17 @@
     }
   }
   {
-    FlutterBasicMessageChannel *channel =
-        [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.play"
-                                           binaryMessenger:binaryMessenger
-                                                     codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.play"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
       NSCAssert([api respondsToSelector:@selector(play:error:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(play:error:)", api);
+                @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(play:error:)",
+                api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         NSArray *args = message;
-        FLTTextureMessage *arg_msg = args[0];
+        FLTTextureMessage *arg_msg = GetNullableObjectAtIndex(args, 0);
         FlutterError *error;
         [api play:arg_msg error:&error];
         callback(wrapResult(nil, error));
@@ -443,16 +458,18 @@
     }
   }
   {
-    FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel
-        messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.position"
-               binaryMessenger:binaryMessenger
-                         codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.position"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
-      NSCAssert([api respondsToSelector:@selector(position:error:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(position:error:)", api);
+      NSCAssert(
+          [api respondsToSelector:@selector(position:error:)],
+          @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(position:error:)",
+          api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         NSArray *args = message;
-        FLTTextureMessage *arg_msg = args[0];
+        FLTTextureMessage *arg_msg = GetNullableObjectAtIndex(args, 0);
         FlutterError *error;
         FLTPositionMessage *output = [api position:arg_msg error:&error];
         callback(wrapResult(output, error));
@@ -462,16 +479,18 @@
     }
   }
   {
-    FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel
-        messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.seekTo"
-               binaryMessenger:binaryMessenger
-                         codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.seekTo"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
-      NSCAssert([api respondsToSelector:@selector(seekTo:error:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(seekTo:error:)", api);
+      NSCAssert(
+          [api respondsToSelector:@selector(seekTo:error:)],
+          @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(seekTo:error:)",
+          api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         NSArray *args = message;
-        FLTPositionMessage *arg_msg = args[0];
+        FLTPositionMessage *arg_msg = GetNullableObjectAtIndex(args, 0);
         FlutterError *error;
         [api seekTo:arg_msg error:&error];
         callback(wrapResult(nil, error));
@@ -481,16 +500,18 @@
     }
   }
   {
-    FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel
-        messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.pause"
-               binaryMessenger:binaryMessenger
-                         codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.pause"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
-      NSCAssert([api respondsToSelector:@selector(pause:error:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(pause:error:)", api);
+      NSCAssert(
+          [api respondsToSelector:@selector(pause:error:)],
+          @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(pause:error:)",
+          api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         NSArray *args = message;
-        FLTTextureMessage *arg_msg = args[0];
+        FLTTextureMessage *arg_msg = GetNullableObjectAtIndex(args, 0);
         FlutterError *error;
         [api pause:arg_msg error:&error];
         callback(wrapResult(nil, error));
@@ -500,17 +521,18 @@
     }
   }
   {
-    FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel
-        messageChannelWithName:@"dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers"
-               binaryMessenger:binaryMessenger
-                         codec:FLTVideoPlayerApiGetCodec()];
+    FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc]
+           initWithName:@"dev.flutter.pigeon.AVFoundationVideoPlayerApi.setMixWithOthers"
+        binaryMessenger:binaryMessenger
+                  codec:FLTAVFoundationVideoPlayerApiGetCodec()];
     if (api) {
       NSCAssert([api respondsToSelector:@selector(setMixWithOthers:error:)],
-                @"FLTVideoPlayerApi api (%@) doesn't respond to @selector(setMixWithOthers:error:)",
+                @"FLTAVFoundationVideoPlayerApi api (%@) doesn't respond to "
+                @"@selector(setMixWithOthers:error:)",
                 api);
       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
         NSArray *args = message;
-        FLTMixWithOthersMessage *arg_msg = args[0];
+        FLTMixWithOthersMessage *arg_msg = GetNullableObjectAtIndex(args, 0);
         FlutterError *error;
         [api setMixWithOthers:arg_msg error:&error];
         callback(wrapResult(nil, error));
diff --git a/packages/video_player/video_player_avfoundation/lib/src/avfoundation_video_player.dart b/packages/video_player/video_player_avfoundation/lib/src/avfoundation_video_player.dart
index bf1518d..5dc6862 100644
--- a/packages/video_player/video_player_avfoundation/lib/src/avfoundation_video_player.dart
+++ b/packages/video_player/video_player_avfoundation/lib/src/avfoundation_video_player.dart
@@ -14,7 +14,7 @@
 /// An iOS implementation of [VideoPlayerPlatform] that uses the
 /// Pigeon-generated [VideoPlayerApi].
 class AVFoundationVideoPlayer extends VideoPlayerPlatform {
-  final VideoPlayerApi _api = VideoPlayerApi();
+  final AVFoundationVideoPlayerApi _api = AVFoundationVideoPlayerApi();
 
   /// Registers this class as the default instance of [VideoPlayerPlatform].
   static void registerWith() {
diff --git a/packages/video_player/video_player_avfoundation/lib/src/messages.g.dart b/packages/video_player/video_player_avfoundation/lib/src/messages.g.dart
index 1a679d5..a745c66 100644
--- a/packages/video_player/video_player_avfoundation/lib/src/messages.g.dart
+++ b/packages/video_player/video_player_avfoundation/lib/src/messages.g.dart
@@ -1,7 +1,7 @@
 // Copyright 2013 The Flutter Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
-// Autogenerated from Pigeon (v1.0.17), do not edit directly.
+// Autogenerated from Pigeon (v2.0.1), do not edit directly.
 // See also: https://pub.dev/packages/pigeon
 // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name
 // @dart = 2.12
@@ -191,8 +191,8 @@
   }
 }
 
-class _VideoPlayerApiCodec extends StandardMessageCodec {
-  const _VideoPlayerApiCodec();
+class _AVFoundationVideoPlayerApiCodec extends StandardMessageCodec {
+  const _AVFoundationVideoPlayerApiCodec();
   @override
   void writeValue(WriteBuffer buffer, Object? value) {
     if (value is CreateMessage) {
@@ -251,20 +251,20 @@
   }
 }
 
-class VideoPlayerApi {
-  /// Constructor for [VideoPlayerApi].  The [binaryMessenger] named argument is
+class AVFoundationVideoPlayerApi {
+  /// Constructor for [AVFoundationVideoPlayerApi].  The [binaryMessenger] named argument is
   /// available for dependency injection.  If it is left null, the default
   /// BinaryMessenger will be used which routes to the host platform.
-  VideoPlayerApi({BinaryMessenger? binaryMessenger})
+  AVFoundationVideoPlayerApi({BinaryMessenger? binaryMessenger})
       : _binaryMessenger = binaryMessenger;
 
   final BinaryMessenger? _binaryMessenger;
 
-  static const MessageCodec<Object?> codec = _VideoPlayerApiCodec();
+  static const MessageCodec<Object?> codec = _AVFoundationVideoPlayerApiCodec();
 
   Future<void> initialize() async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.initialize', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.initialize', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
         await channel.send(null) as Map<Object?, Object?>?;
@@ -272,7 +272,6 @@
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -289,15 +288,14 @@
 
   Future<TextureMessage> create(CreateMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.create', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.create', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -307,6 +305,11 @@
         message: error['message'] as String?,
         details: error['details'],
       );
+    } else if (replyMap['result'] == null) {
+      throw PlatformException(
+        code: 'null-error',
+        message: 'Host platform returned null value for non-null return value.',
+      );
     } else {
       return (replyMap['result'] as TextureMessage?)!;
     }
@@ -314,15 +317,14 @@
 
   Future<void> dispose(TextureMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.dispose', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.dispose', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -339,15 +341,14 @@
 
   Future<void> setLooping(LoopingMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.setLooping', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.setLooping', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -364,15 +365,14 @@
 
   Future<void> setVolume(VolumeMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.setVolume', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.setVolume', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -389,15 +389,14 @@
 
   Future<void> setPlaybackSpeed(PlaybackSpeedMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.setPlaybackSpeed', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -414,15 +413,14 @@
 
   Future<void> play(TextureMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.play', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.play', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -439,15 +437,14 @@
 
   Future<PositionMessage> position(TextureMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.position', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.position', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -457,6 +454,11 @@
         message: error['message'] as String?,
         details: error['details'],
       );
+    } else if (replyMap['result'] == null) {
+      throw PlatformException(
+        code: 'null-error',
+        message: 'Host platform returned null value for non-null return value.',
+      );
     } else {
       return (replyMap['result'] as PositionMessage?)!;
     }
@@ -464,15 +466,14 @@
 
   Future<void> seekTo(PositionMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.seekTo', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.seekTo', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -489,15 +490,14 @@
 
   Future<void> pause(TextureMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.pause', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.pause', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
@@ -514,15 +514,14 @@
 
   Future<void> setMixWithOthers(MixWithOthersMessage arg_msg) async {
     final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-        'dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers', codec,
+        'dev.flutter.pigeon.AVFoundationVideoPlayerApi.setMixWithOthers', codec,
         binaryMessenger: _binaryMessenger);
     final Map<Object?, Object?>? replyMap =
-        await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
+        await channel.send(<Object?>[arg_msg]) as Map<Object?, Object?>?;
     if (replyMap == null) {
       throw PlatformException(
         code: 'channel-error',
         message: 'Unable to establish connection on channel.',
-        details: null,
       );
     } else if (replyMap['error'] != null) {
       final Map<Object?, Object?> error =
diff --git a/packages/video_player/video_player_avfoundation/pigeons/messages.dart b/packages/video_player/video_player_avfoundation/pigeons/messages.dart
index d357caf..e6eda59 100644
--- a/packages/video_player/video_player_avfoundation/pigeons/messages.dart
+++ b/packages/video_player/video_player_avfoundation/pigeons/messages.dart
@@ -58,7 +58,7 @@
 }
 
 @HostApi(dartHostTestHandler: 'TestHostVideoPlayerApi')
-abstract class VideoPlayerApi {
+abstract class AVFoundationVideoPlayerApi {
   @ObjCSelector('initialize')
   void initialize();
   @ObjCSelector('create:')
diff --git a/packages/video_player/video_player_avfoundation/pubspec.yaml b/packages/video_player/video_player_avfoundation/pubspec.yaml
index 044d15b..0e42c26 100644
--- a/packages/video_player/video_player_avfoundation/pubspec.yaml
+++ b/packages/video_player/video_player_avfoundation/pubspec.yaml
@@ -2,7 +2,7 @@
 description: iOS implementation of the video_player plugin.
 repository: https://github.com/flutter/plugins/tree/master/packages/video_player/video_player_avfoundation
 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
-version: 2.3.0
+version: 2.3.1
 
 environment:
   sdk: ">=2.14.0 <3.0.0"
@@ -24,4 +24,4 @@
 dev_dependencies:
   flutter_test:
     sdk: flutter
-  pigeon: ^1.0.17
+  pigeon: ^2.0.1
diff --git a/packages/video_player/video_player_avfoundation/test/test_api.dart b/packages/video_player/video_player_avfoundation/test/test_api.dart
index 191358e..af6d072 100644
--- a/packages/video_player/video_player_avfoundation/test/test_api.dart
+++ b/packages/video_player/video_player_avfoundation/test/test_api.dart
@@ -1,7 +1,7 @@
 // Copyright 2013 The Flutter Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
-// Autogenerated from Pigeon (v1.0.17), do not edit directly.
+// Autogenerated from Pigeon (v2.0.1), do not edit directly.
 // See also: https://pub.dev/packages/pigeon
 // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis
 // ignore_for_file: avoid_relative_lib_imports
@@ -93,7 +93,7 @@
       {BinaryMessenger? binaryMessenger}) {
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.initialize', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.initialize', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
@@ -107,18 +107,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.create', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.create', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.create was null.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.create was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final CreateMessage? arg_msg = (args[0] as CreateMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.create was null, expected non-null CreateMessage.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.create was null, expected non-null CreateMessage.');
           final TextureMessage output = api.create(arg_msg!);
           return <Object?, Object?>{'result': output};
         });
@@ -126,18 +126,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.dispose', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.dispose', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.dispose was null.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.dispose was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final TextureMessage? arg_msg = (args[0] as TextureMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.dispose was null, expected non-null TextureMessage.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.dispose was null, expected non-null TextureMessage.');
           api.dispose(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -145,18 +145,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.setLooping', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.setLooping', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setLooping was null.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.setLooping was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final LoopingMessage? arg_msg = (args[0] as LoopingMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setLooping was null, expected non-null LoopingMessage.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.setLooping was null, expected non-null LoopingMessage.');
           api.setLooping(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -164,18 +164,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.setVolume', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.setVolume', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setVolume was null.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.setVolume was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final VolumeMessage? arg_msg = (args[0] as VolumeMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setVolume was null, expected non-null VolumeMessage.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.setVolume was null, expected non-null VolumeMessage.');
           api.setVolume(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -183,19 +183,20 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.setPlaybackSpeed',
+          codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed was null.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.setPlaybackSpeed was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final PlaybackSpeedMessage? arg_msg =
               (args[0] as PlaybackSpeedMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setPlaybackSpeed was null, expected non-null PlaybackSpeedMessage.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.setPlaybackSpeed was null, expected non-null PlaybackSpeedMessage.');
           api.setPlaybackSpeed(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -203,18 +204,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.play', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.play', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.play was null.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.play was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final TextureMessage? arg_msg = (args[0] as TextureMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.play was null, expected non-null TextureMessage.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.play was null, expected non-null TextureMessage.');
           api.play(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -222,18 +223,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.position', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.position', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.position was null.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.position was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final TextureMessage? arg_msg = (args[0] as TextureMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.position was null, expected non-null TextureMessage.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.position was null, expected non-null TextureMessage.');
           final PositionMessage output = api.position(arg_msg!);
           return <Object?, Object?>{'result': output};
         });
@@ -241,18 +242,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.seekTo', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.seekTo', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.seekTo was null.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.seekTo was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final PositionMessage? arg_msg = (args[0] as PositionMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.seekTo was null, expected non-null PositionMessage.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.seekTo was null, expected non-null PositionMessage.');
           api.seekTo(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -260,18 +261,18 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.pause', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.pause', codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.pause was null.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.pause was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final TextureMessage? arg_msg = (args[0] as TextureMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.pause was null, expected non-null TextureMessage.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.pause was null, expected non-null TextureMessage.');
           api.pause(arg_msg!);
           return <Object?, Object?>{};
         });
@@ -279,19 +280,20 @@
     }
     {
       final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
-          'dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers', codec,
+          'dev.flutter.pigeon.AVFoundationVideoPlayerApi.setMixWithOthers',
+          codec,
           binaryMessenger: binaryMessenger);
       if (api == null) {
         channel.setMockMessageHandler(null);
       } else {
         channel.setMockMessageHandler((Object? message) async {
           assert(message != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers was null.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.setMixWithOthers was null.');
           final List<Object?> args = (message as List<Object?>?)!;
           final MixWithOthersMessage? arg_msg =
               (args[0] as MixWithOthersMessage?);
           assert(arg_msg != null,
-              'Argument for dev.flutter.pigeon.VideoPlayerApi.setMixWithOthers was null, expected non-null MixWithOthersMessage.');
+              'Argument for dev.flutter.pigeon.AVFoundationVideoPlayerApi.setMixWithOthers was null, expected non-null MixWithOthersMessage.');
           api.setMixWithOthers(arg_msg!);
           return <Object?, Object?>{};
         });