Issue 1:
I have 4 videos and playing first video when app starts. While playing first video, I want to initialize other three videos so that playing smoothly. I initialized all four videos in same isolate, then sometimes UI freezes. So to avoid that I want to initialize other three videos in different isolate (not main isolate) so that UI won't freeze. I tried like so.

Code:

VideoPlayerController _firstController;
VideoPlayerController _secondController;
VideoPlayerController _thirdController;
VideoPlayerController _fourthController;
static List<VideoPlayerController> _controllers;
List<String> urls = [url1, url2, url3, url4];

@override
void initState() {
_controllers = [
_firstController,
_secondController,
_thirdController,
_fourthController,
];
_initVideo();
_initFirstThree();
super.initState();
}

_initVideo() async {
_controllers[0] = new VideoPlayerController.network(urls[0]);
await _controllers[0].initialize();
await _controllers[0].setLooping(true);
await _controllers[0].play();
setState(() {});
}

_initFirstThree() async {
for (int i = 1; i < urls.length; i++) {
await initializeVideo(i, urls[i]);
}
}

Future initializeVideo(int index, String url) async {
final ReceivePort receivePort = ReceivePort();
await Isolate.spawn(isolateInit, receivePort.sendPort);

final SendPort sendPort = await receivePort.first;
final VideoPlayerController result = await sendReceive(sendPort, url);

_controllers[index] = result;
await result.dispose();
}

static isolateInit(SendPort sendPort) async {
final ReceivePort receivePort = ReceivePort();
sendPort.send(receivePort.sendPort);

final msg = await receivePort.first;

final String url = msg[0];
final SendPort replyPort = msg[1];

final VideoPlayerController controller = new VideoPlayerController.network(url);
await controller.initialize();
await controller.setLooping(true);

replyPort.send(controller);

}

Future sendReceive(SendPort send, message) {
final ReceivePort receivePort = ReceivePort();
send.send([message, receivePort.sendPort]);
return receivePort.first;
}

But after first video initialized successfully, exception says those.

Is this flutter error or am I missing something?

[VERBOSE-2:dart_isolate.cc(813)] Isolate (56689054) 'main.dart: isolateInit()' exited with an error
[VERBOSE-2:shell.cc(181)] Dart Error: Unhandled exception:
NoSuchMethodError: The method 'addObserver' was called on null.
Receiver: null
Tried calling: addObserver(Instance of '_VideoAppLifeCycleObserver')
#0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:48:5)
#1 _VideoAppLifeCycleObserver.initialize (package:video_player/video_player.dart:398:29)
#2 VideoPlayerController.initialize (package:video_player/video_player.dart:187:24)
<asynchronous suspension>
#3 _SwiperScreenState. isolateInit (package:komama/video_swiper.dart:115:24)
<asynchronous suspension>
#4 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:292:17)
#5 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)

Flutter doctor

[flutter] flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.7.3, on Mac OS X 10.13.6 17G65, locale pt-BR)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.1)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[✓] Android Studio (version 3.1)
[✓] Connected devices (2 available)

! Doctor found issues in 1 category.
exit code 0

Issue 2:
Status

9/9/22: Work- in-progress

Description

When I try to invoke a platform channel method from a custom spawned isolate, the app crashes badly (both on iOS and Android). I'm trying to figure out whether this is expected or not.

If it's not, it's probably worth to mention that somewhere.

Anyways I think that this can potentially be a strong limitation. Is there a way to be able to call platform plugins from a secondary isolate?

PRs

iOS Engine - flutter/engine#35174

iOS Framework - #109005

Reland iOS Framework - #111320

Android Engine - flutter/engine#35804

Android Framework - #111279

Add macOS platform channel integration tests - #110606

Desktop Engine - flutter/engine#35893

Desktop Framework - #110882

Add samplecode - #112235

Update website documentation - flutter/website#7592

Make it work with plugins that require a dart plugin registrant - #112240