betterplayer
betterplayer copied to clipboard
[BUG] Incompatible with video_player: ^2.4.5
After updating project dependencies. BettetPlayer doesn't work anymore.
I/ExoPlayerImpl( 7316): Init f6c2363 [ExoPlayerLib/2.18.0] [generic_x86_arm, sdk_gphone_x86, Google, 30]
E/MethodChannel#better_player_channel( 7316): Failed to handle method call
E/MethodChannel#better_player_channel( 7316): java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider no longer handles null by instantiating a new DefaultDrmSessionManagerProvider. Explicitly construct and pass an instance in order to retain the old behavior.
E/MethodChannel#better_player_channel( 7316): at com.google.android.exoplayer2.util.Assertions.checkNotNull(Assertions.java:174)
E/MethodChannel#better_player_channel( 7316): at com.google.android.exoplayer2.source.hls.HlsMediaSource$Factory.setDrmSessionManagerProvider(HlsMediaSource.java:296)
E/MethodChannel#better_player_channel( 7316): at com.jhomlala.better_player.BetterPlayer.buildMediaSource(BetterPlayer.kt:424)
E/MethodChannel#better_player_channel( 7316): at com.jhomlala.better_player.BetterPlayer.setDataSource(BetterPlayer.kt:196)
E/MethodChannel#better_player_channel( 7316): at com.jhomlala.better_player.BetterPlayerPlugin.setDataSource(BetterPlayerPlugin.kt:277)
E/MethodChannel#better_player_channel( 7316): at com.jhomlala.better_player.BetterPlayerPlugin.onMethodCall(BetterPlayerPlugin.kt:151)
E/MethodChannel#better_player_channel( 7316): at com.jhomlala.better_player.BetterPlayerPlugin.onMethodCall(BetterPlayerPlugin.kt:138)
E/MethodChannel#better_player_channel( 7316): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/MethodChannel#better_player_channel( 7316): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#better_player_channel( 7316): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#better_player_channel( 7316): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#better_player_channel( 7316): at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#better_player_channel( 7316): at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#better_player_channel( 7316): at android.os.Looper.loop(Looper.java:223)
E/MethodChannel#better_player_channel( 7316): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/MethodChannel#better_player_channel( 7316): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#better_player_channel( 7316): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/MethodChannel#better_player_channel( 7316): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Flutter Version : 3.0.5 Test on: Emulator Android 12 x86_64 and Samsung A5 Android 8
After debugging, I realized that this is because of the ExoPlayer version
https://github.com/flutter/plugins/blob/main/packages/video_player/video_player_android/android/build.gradle#L46
Just happened to me too. @jhomlala Please update exoplayer version :)
Also experiencing the same issue... Is there a fix?
Also experiencing the same issue... Is there a fix?
I temporarily solved it with this method:
- change video player version to =>
video_player: ^2.4.4
- edit pubspec.lock and make this changes =>
video_player:
dependency: "direct main"
description:
name: video_player
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.4"
video_player_android:
dependency: transitive
description:
name: video_player_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.7"
video_player_avfoundation:
dependency: transitive
description:
name: video_player_avfoundation
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.5"
video_player_platform_interface:
dependency: transitive
description:
name: video_player_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.3"
video_player_web:
dependency: transitive
description:
name: video_player_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.12"
Same here
Here is a PR for the issue: https://github.com/jhomlala/betterplayer/pull/1059
Here is a PR for the issue: #1059
that's solved the problem thank you @matthewrice345
Still present bug, but @matthewrice345 saved the day, thanks !
@jhomlala any chance this can be merged?
This is how I solved it. Just put in your pubspec.yaml
better_player: git: url: https://github.com/tintran-dev/betterplayer.git video_player: any
Regards!
On Tue, Feb 7, 2023, 4:39 PM JonasJW @.***> wrote:
@jhomlala https://github.com/jhomlala any chance this can be merged?
— Reply to this email directly, view it on GitHub https://github.com/jhomlala/betterplayer/issues/1057#issuecomment-1421342379, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABALFG2C3OCDHMFJGU5EZSLWWKQGLANCNFSM54N4QKOA . You are receiving this because you commented.Message ID: @.***>
@tuvia what are the differences to @matthewrice345 PR?
I'm not really sure... Googling for a solution just found this and thought it could be useful for other people.
Thank you so much for your efforts in making betterplayer!
On Wed, Feb 8, 2023, 5:37 AM JonasJW @.***> wrote:
@tuvia https://github.com/tuvia what are the differences to @matthewrice345 https://github.com/matthewrice345 PR?
— Reply to this email directly, view it on GitHub https://github.com/jhomlala/betterplayer/issues/1057#issuecomment-1422226346, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABALFG3FNARZATBELSCNJ23WWNLLHANCNFSM54N4QKOA . You are receiving this because you were mentioned.Message ID: @.***>