jhomlala / betterplayer

Better video player for Flutter, with multiple configuration options. Solving typical use cases!
Apache License 2.0
923 stars 995 forks source link

[BUG] java.lang.NullPointerException: MediaSource.Factory#setDrmSessionManagerProvider no longer handles null #1327

Open princh-techindustan opened 3 weeks ago

princh-techindustan commented 3 weeks ago

I'm encountering a NullPointerException when using the better_player library on Android. The error seems to occur during video playback, with the following message: This issue is happening on Android, but the same video works perfectly fine on iOS.

Steps to reproduce:

Implement video playback using better_player on Android. Run the app and attempt to play a video. The app crashes with the above error. Expected behavior: The video should play normally on Android, similar to how it behaves on iOS.

Environment:

Library version: 0.0.84 Flutter version: 3.24.2 Device: Android Additional Context: It seems like the MediaSource.Factory method is no longer instantiating a DefaultDrmSessionManagerProvider automatically when null is passed, causing the crash. Explicitly passing an instance of DefaultDrmSessionManagerProvider might resolve the issue.

Please look into this as it severely impacts video playback functionality on Android.

redwildrider commented 2 weeks ago

I have the same issue

Buenaventura-Celine commented 2 weeks ago

I also have the same issue.

afrahshaikh commented 2 days ago

hey, i have resolved the drm issue. Add this to pubspec.yaml better_player: git: url: 'https://github.com/afrahshaikh/even_better_player.git' ref: main