abdelaziz-mahdy / flutter_meedu_videoplayer

Cross-Platform Video Player for flutter
https://abdelaziz-mahdy.github.io/flutter_meedu_videoplayer/
MIT License
132 stars 69 forks source link

Android with media_kit libmpv.so not found, web memory usage #68

Closed AnonymHK closed 1 year ago

AnonymHK commented 1 year ago

I have tried running the latest version example, but there is an error under Android: E/Flutter (15191): [ERROR: Flutter/runtime/start_vm_initializer. cc (41)] Unhandled Exception: Exception: Cannot find libmpv. so. Please ensure its presence in the APK

Basic in Web version_ Network example error:

ERROR - 2023-05-09 15:33:40.320422

GET /flutter meedu videoplayer example/C:/b/s/w/ir/cache/builder/src/out/host debug/dart-sdk/lib/ internal/js dev runtime/patch/core patch.dart

Error thrown by handler.

Invalid argument(s): Uri c:/b/s/w/ir/cache/builder/src/out/host debug/dart-sdk/lib/ internal/js dev runtime/patch/core_ patch.dart must have scheme 'file:'.

There were no issues with the previous version. These two errors occurred when I was running the latest version of the example. I am not sure if it was due to abandoning kt and using Java. There is also an issue. During web version testing, I found that there was a noticeable lag in playing videos on the web after version 4.2.6. I checked the memory usage and found that the memory usage after version 4.2.6 was much larger than before!

AnonymHK commented 1 year ago

My web debugging environment: vscode+Fluter (Chrome)

Flutter version: Channel stable, 3.7.12

Dart SDK version: 2.19.6 (stable)

abdelaziz-mahdy commented 1 year ago

I have tried running the latest version example, but there is an error under Android: E/Flutter (15191): [ERROR: Flutter/runtime/start_vm_initializer. cc (41)] Unhandled Exception: Exception: Cannot find libmpv. so. Please ensure its presence in the APK

Basic in Web version_ Network example error:

ERROR - 2023-05-09 15:33:40.320422

GET /flutter meedu videoplayer example/C:/b/s/w/ir/cache/builder/src/out/host debug/dart-sdk/lib/ internal/js dev runtime/patch/core patch.dart

Error thrown by handler.

Invalid argument(s): Uri c:/b/s/w/ir/cache/builder/src/out/host debug/dart-sdk/lib/ internal/js dev runtime/patch/core_ patch.dart must have scheme 'file:'.

There were no issues with the previous version. These two errors occurred when I was running the latest version of the example. I am not sure if it was due to abandoning kt and using Java. There is also an issue. During web version testing, I found that there was a noticeable lag in playing videos on the web after version 4.2.6. I checked the memory usage and found that the memory usage after version 4.2.6 was much larger than before!

The java converting is only on GitHub not released on pub.dev

The libmpv.so error is related to using Android media_kit and not adding it to pubspec.yaml

Are you using hls on web?

Note: I didn't change anything related to playback in the last update, so can you provide an example or let me know if it happens in package examples too.

AnonymHK commented 1 year ago

I haven't made any modifications, just downloaded the code on GitHub and ran the example directly! I think you should do some basic testing. I used HLS on the network, but I only ran the example and the program made an error!

abdelaziz-mahdy commented 1 year ago

I haven't made any modifications, just downloaded the code on GitHub and ran the example directly! I think you should do some basic testing. I used HLS on the network, but I only ran the example and the program made an error!

What is the error and what example did you test.

I need more information.

abdelaziz-mahdy commented 1 year ago

I just tested the deployed https://zezo357.github.io/flutter_meedu_videoplayer_example/#/

And it's working as expected. Can you elaborate more on what is causing your problem and how can I test it .

Like a url on which you test or example to what you test,

From the above error you were trying to play a local file on web which is not available.

abdelaziz-mahdy commented 1 year ago

can you git pull and test again? it should not throw any errors

AnonymHK commented 1 year ago

1111111

I am running the latest version of the basic network example, It played normally, but threw an error!

AnonymHK commented 1 year ago

image fc5a5775c0a8d6204da4ad9cf248017

I have re downloaded the complete package from Github and the web is now working properly!

abdelaziz-mahdy commented 1 year ago

Please uncomment the media_kit libs for Android

In pubspec.yaml and pub get and close the app and recompile

This is why android is failing

Or

Set initmeeduplayer androidusemediakit as false

AnonymHK commented 1 year ago

I would like to know the advantages of using 'media_kit' on Android? Additional so files may increase the package size of APK files!

image

It seems that I cannot use 'media_kit'

abdelaziz-mahdy commented 1 year ago

Flutter clean and recompile it should work