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

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

Open
princh-techindustan opened this issue Sep 5, 2024 · 6 comments
Assignees
Labels
new issue New issue which has not been checked yet

Comments

@princh-techindustan
Copy link

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.

@princh-techindustan princh-techindustan added the new issue New issue which has not been checked yet label Sep 5, 2024
@redwildrider
Copy link

I have the same issue

@Buenaventura-Celine
Copy link

I also have the same issue.

@afrahshaikh
Copy link

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

@ankitks2506
Copy link

Is this issue resolved? I am still facing this issue with better_player. However, this is not the only package with the issue. I face similar issue with cached_network_image where it works fine on iOS and not on Android. Similarly, shared_preferences throws exception when running the app on Android but not on iOS.

@JonasJW
Copy link

JonasJW commented Nov 5, 2024

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

I'm getting the error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':better_player:packageDebugResources'.
> Error while evaluating property 'namespace' of task ':better_player:packageDebugResources'
   > Failed to calculate the value of task ':better_player:packageDebugResources' property 'namespace'.
      > Failed to calculate the value of property 'namespace'.
         > Package Name not found in /Users/jonas/.pub-cache/git/even_better_player-753e864919433b23a7d285d29cfa796a0b14f0d7/android/src/main/AndroidManifest.xml, and namespace not specified. Please specify a namespace for the generated R and BuildConfig classes via android.namespace in the module's build.gradle file like so:

           android {
               namespace 'com.example.namespace'
           }

Any chance you can submit a PR for this fix?

@afrah-tezda
Copy link

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

I'm getting the error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':better_player:packageDebugResources'.
> Error while evaluating property 'namespace' of task ':better_player:packageDebugResources'
   > Failed to calculate the value of task ':better_player:packageDebugResources' property 'namespace'.
      > Failed to calculate the value of property 'namespace'.
         > Package Name not found in /Users/jonas/.pub-cache/git/even_better_player-753e864919433b23a7d285d29cfa796a0b14f0d7/android/src/main/AndroidManifest.xml, and namespace not specified. Please specify a namespace for the generated R and BuildConfig classes via android.namespace in the module's build.gradle file like so:

           android {
               namespace 'com.example.namespace'
           }

Any chance you can submit a PR for this fix?

fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue New issue which has not been checked yet
Projects
None yet
Development

No branches or pull requests

8 participants