Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Video Player] PlatformException occurs in video_player example #78

Closed
makotosato-at opened this issue Aug 24, 2023 · 12 comments · Fixed by #80
Closed

[Video Player] PlatformException occurs in video_player example #78

makotosato-at opened this issue Aug 24, 2023 · 12 comments · Fixed by #80
Labels
bug Something isn't working

Comments

@makotosato-at
Copy link
Contributor

Hello.

I'm using Debian(bullseye) on my PC(x86_64) and flutter-elinux 3.13.0
When I run the video_player example, I get the following error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      AndroidVideoPlayerApi.initialize (package:video_player_android/src/messages.g.dart:272)
<asynchronous suspension>

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      AndroidVideoPlayerApi.setMixWithOthers (package:video_player_android/src/messages.g.dart:522)
<asynchronous suspension>
#1      VideoPlayerController.initialize (package:video_player/video_player.dart:361)
<asynchronous suspension>

Here are the steps:

$ git clone https://github.com/sony/flutter-elinux-plugins.git
$ cd flutter-elinux-plugins/packages/video_player/example
$ flutter-elinux pub get
$ flutter-elinux run -d elinux-x11 --release

It does not occur in debug mode(--debug).

@HidenoriMatsubayashi
Copy link
Collaborator

First of all, didn't you encounter build errors with flutter-elinux 3.13.0? Because event_channel API was wrong in 3.13.0 (See sony/flutter-embedded-linux@23589c3).

@makotosato-at
Copy link
Contributor Author

Sorry. I forgot to inform.
I fixed flutter/bin/cache/artifacts/engine/elinux-common/cpp_client_wrapper/include/flutter/event_channel.h manually and then tried.

@HidenoriMatsubayashi
Copy link
Collaborator

I was unable to reproduce the issue.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      AndroidVideoPlayerApi.initialize (package:video_player_android/src/messages.g.dart:272)
<asynchronous suspension>

This is strange. VideoPlayer for eLinux doesn't use AndroidVideoPlayer though... Can you please try again on the top of the flutter-elinux main tree?

@makotosato-at
Copy link
Contributor Author

Can you please try again on the top of the flutter-elinux main tree?

I tried but it did not work...
The same issue occurred on another PC(x86_64/Ubuntu 22.04 LTS).

@HidenoriMatsubayashi
Copy link
Collaborator

Can you share whole logs?

flutter-elinux run -d elinux-x11 --release -vv

@makotosato-at
Copy link
Contributor Author

I got the log.
flutter_log.txt

@HidenoriMatsubayashi
Copy link
Collaborator

Hmm, it looks good. BTW, does this issue depend on flutter-elinux version?

@makotosato-at
Copy link
Contributor Author

Hmm, it looks good. BTW, does this issue depend on flutter-elinux version?

It occurs in 3.13.0 or later.
Works fine in 3.10.6.

@HidenoriMatsubayashi
Copy link
Collaborator

I was able to reproduce this issue on x64 Linux host. It appears it occurs only on x64 host. It works fine on arm64 host.

@HidenoriMatsubayashi HidenoriMatsubayashi added the bug Something isn't working label Aug 25, 2023
HidenoriMatsubayashi added a commit that referenced this issue Aug 25, 2023
This change updates flutter and dart-sdk versions in pubspec.yaml for flutter 3.13.0

Related issue: #78

Signed-off-by: Hidenori Matsubayashi <Hidenori.Matsubayashi@gmail.com>
HidenoriMatsubayashi added a commit to HidenoriMatsubayashi/flutter-elinux-plugins that referenced this issue Aug 25, 2023
This change fixes sony#78 issue of AndroidVideoPlayer being used on x64 host PC for some reason. To fix it, this change adds ELinuxVideoPlayer dart plugin class as a VideoPlayerPlatform for eLinux.

Signed-off-by: Hidenori Matsubayashi <Hidenori.Matsubayashi@gmail.com>
HidenoriMatsubayashi added a commit that referenced this issue Aug 25, 2023
This change fixes #78 issue of AndroidVideoPlayer being used on x64 host PC for some reason. To fix it, this change adds ELinuxVideoPlayer dart plugin class as a VideoPlayerPlatform for eLinux.

Signed-off-by: Hidenori Matsubayashi <Hidenori.Matsubayashi@gmail.com>
@HidenoriMatsubayashi
Copy link
Collaborator

This issue should be resolved in #80. Can you please confirm if it's fixed in the latest plugin source files?

@makotosato-at
Copy link
Contributor Author

Thank you.
It works fine.

One thing I noticed.
In x86 and release mode, Platform.operatingSystem returns 'android'. (3.13.0 or later)
This may be the root of this issue.
(returns 'linux' in 3.10.6)

@HidenoriMatsubayashi
Copy link
Collaborator

Thanks. I filed sony/flutter-elinux#212.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants