在Android Chrome中隐藏HTML5音频/视频通知 [英] Hide HTML5 Audio/Video notification in Android Chrome

查看:101
本文介绍了在Android Chrome中隐藏HTML5音频/视频通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网络应用有一个HTML5音频元素。在某些时候,我以编程方式停止播放,使用以下代码:
$ b

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;

音频播放时,我的Android设备上会发出通知(使用Google Chrome)。我希望这个通知消失后,我停止播放,但它没有。

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?

推荐答案

这通过将src属性设置为空白并再次加载。下面是一行代码

you can do this by setting src attribute to blank and load it again. below is line of code

audioElement.setAttribute('src','');
audioElement.load();

audioElement.setAttribute('src', ''); audioElement.load();

它适用于我的视频元素,但同样的问题。快乐编码.....

it worked for me for Video element but for same problem. Happy Coding.....

这篇关于在Android Chrome中隐藏HTML5音频/视频通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆