I have an HTML5 Audio element on my web app. At some point, I programmatically stop the playback, using this code:
audioElement.pause();
audioElement.currentTime = 0;
When the audio is playing, there is a notification on my Android device (using Google Chrome). I would expect this notification to disappear once I stop the playback, but it doesn't.
How do I remove the notification?
you can do this by setting src attribute to blank and load it again. below is line of code
audioElement.setAttribute('src', ''); audioElement.load();
it worked for me for Video element but for same problem. Happy Coding.....
Amit Bhagra
Below code works for me
audioElement.pause();
audioElement.currentTime = 0;
audioElement.load();
来源:https://stackoverflow.com/questions/40843798/hide-html5-audio-video-notification-in-android-chrome