javascript - 声音不会在A-Frame中的单击事件上停止

标签 javascript html audio aframe

 <a-assets>
          <audio id="river" src="river.mp3" preload="auto">
          </audio>   
 </a-assets>   
 <a-entity sound="src: #river"></a-entity> 
var entity = document.querySelector('[sound]');
entity.components.sound.stopSound();

最佳答案

document.querySelector('audio').stop();有效还是entity.pause()有效?

关于javascript - 声音不会在A-Frame中的单击事件上停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44717914/

相关文章:

javascript - 最大回文算法-JS

javascript - 从 URL 在网页内执行 javascript 函数?

codeigniter中的php四舍五入

html - 音频标签 : Is Audio tag the same as Web Audio API?

javascript - 如何使用<audio>标签html5再现声音序列

iphone - iOS - 如何在更改 View 时停止背景音乐

javascript - Handlebars 中的索引运算符说 Unexpected token ,

javascript - 如何使用 Javascript 正则表达式匹配乱序字符串

javascript - 如何检测angularjs中的水平滚动事件?

javascript - 错误: this language feature is only supported for ECMASCRIPT6 mode or better 【Google Tag Manager】