在A-Frame中单击事件时声音不会停止

时间:2017-06-23 09:29:33

标签: 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();

1 个答案:

答案 0 :(得分:0)

document.querySelector('audio').stop();是否有效或entity.pause()