首页 > 解决方案 > 如何在屏幕关闭或启动第二个时暂停音频标签

问题描述

我正在尝试在移动屏幕关闭或运行第二个音频标签时暂停音频。这是我的 html 代码的示例

<audio controls>
  <source src="audio1.mp3">
  Does not support the audio element.
</audio>
<audio controls>
  <source src="audio2.mp3">
  Does not support the audio element.
</audio>

不幸的是,我不知道如何让 EventListener 来检查上述情况。

标签: javascripthtmltypescriptionic-frameworkionic3

解决方案


推荐阅读