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] MediaElement Notification Prompt Overrides and Alters Push Notification Settings on Android #2364

Open
2 tasks done
vikher opened this issue Nov 30, 2024 · 1 comment
Labels
bug Something isn't working 📽️ MediaElement Issue/PR that has to do with MediaElement needs discussion Discuss it on the next Monthly standup

Comments

@vikher
Copy link

vikher commented Nov 30, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

The MediaElement component triggers a notification prompt asking for permission to send notifications, even when the user is only trying to play a video.
The prompt causes confusion, as selecting "Allow" or "Don't Allow" unintentionally modifies the push notification settings, which is unrelated to video playback.
Image

Expected Behavior

The MediaElement should not trigger a notification prompt if it is unrelated to video playback.
The notification prompt should not affect or change the notification settings in any way.
There should be a way to customize or disable this prompt for better user experience.

Steps To Reproduce

  1. Start the app and navigate to a page with a MediaElement component (video player).
  2. Attempt to play a video.
  3. The notification prompt appears, asking for permission to send notifications.
  4. Selecting either "Allow" or "Don't Allow" affects push notification settings, which could confuse the user.

Link to public reproduction project repository

https://github.com/CommunityToolkit/Maui/tree/main/samples

Environment

- .NET MAUI CommunityToolkit:9.1.0
- OS:Android
- .NET MAUI:8.9.92

Anything else?

references the existing discussion on GitHub to provide more context and indicate that no attention has been given to the issue so far. This should help bring awareness to the problem and possibly generate more responses or solutions.
#2074

@vikher vikher added bug Something isn't working unverified labels Nov 30, 2024
@vikher vikher changed the title [BUG] Override or Disable MediaElement Notification Prompt on Android [BUG] MediaElement Notification Prompt Overrides and Alters Push Notification Settings on Android Nov 30, 2024
@ne0rrmatrix
Copy link
Contributor

Media Element uses notifications to put the controls in the notification tray. If you can upvote #2074 I would appreciate it. I will bring it up at the next monthly toolkit meeting. It is a good idea and we should implement a way to disable requesting notifications so developers can handle it directly. ATM we are blocked from new PR being commited to main until we merge #2215 and then we need to merge #2075 which is currently blocked by dotnet/android#9535 which we have to wait for new version of dotnet android to be pushed to visual studio stable.

We can talk about updating media element to support this and I will work on a PR to fix it and add support to allow developers to choose whether to disable notifications and/or add support and control it themselves. Disabling notifications or not having support when media element is running will disable support for both lockscreen and notification controls. This will also prevent the service from running but will not impact media element running directly. Upvoting the discussion shows us how many ppl are interested in a feature and will allow me to show strong support if it has enough upvotes. I will try and push it through either way as I believe it should be done. I don't see a downside.
We will need to update the docs to reflect the changes if we do this too.

We are currently working on merging a PR that switches us from using deprecated android libraries and using media 3 instead of older libs.

@ne0rrmatrix ne0rrmatrix added needs discussion Discuss it on the next Monthly standup 📽️ MediaElement Issue/PR that has to do with MediaElement and removed unverified labels Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📽️ MediaElement Issue/PR that has to do with MediaElement needs discussion Discuss it on the next Monthly standup
Projects
None yet
Development

No branches or pull requests

2 participants