react-player
react-player copied to clipboard
[Chrome/Android] Media notification persists even after player is unmounted
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
- Start a video (muted)
- Unmute video
- Navigate away (in your SPA) so player is unmounted
Environment
- URL attempting to play: File url
- Browser: Chrome
- Operating system: Android
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?
Same problem. Looking for a solution as well.