react-player icon indicating copy to clipboard operation
react-player copied to clipboard

[Chrome/Android] Media notification persists even after player is unmounted

Open fabyeah opened this issue 3 years ago • 2 comments

Current Behavior

When a video (longer than 5 seconds) was unmuted and then the player is unmounted, a media session notification will appear: https://developers.google.com/web/updates/2015/07/media-notifications

Expected Behavior

When the player is unmounted, any media session notification related to it should disappear. Ideally I don't even want it to appear in the first place.

Steps to Reproduce

  1. Start a video (muted)
  2. Unmute video
  3. Navigate away (in your SPA) so player is unmounted

Environment

  • URL attempting to play: File url
  • Browser: Chrome
  • Operating system: Android

fabyeah avatar Jul 08 '21 19:07 fabyeah

As per this comment, when the player is removed, the notification should be removed, which doesn't happen: https://github.com/w3c/mediasession/issues/215#issuecomment-500530575

I also tried setting the player url to an empty string, but that doesn't remove the notification either.

I'm using an .mp4 video by the way. Maybe it's somehow possible to use Web Audio for the audio part of the video, which supposedly won't create this notification?

fabyeah avatar Jul 08 '21 19:07 fabyeah

Same problem. Looking for a solution as well.

gabrielmlinassi avatar Jul 23 '21 03:07 gabrielmlinassi