【问题标题】:Sound is not going to stop on click event in A-FrameA-Frame 中的点击事件不会停止声音
【发布时间】:2017-06-23 09:29:32
【问题描述】:

 <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();

【问题讨论】:

  • 欢迎来到 SO。请访问help center 了解询问内容和方式。在这种情况下,问题是什么?
  • 我想问题是:为什么它不起作用。老实说,试图复制这段代码,我的 .mp3 也没有停止。

标签: javascript html audio aframe


【解决方案1】:

document.querySelector('audio').stop(); 工作还是 entity.pause() 工作?

【讨论】:

  • 我试过 document.querySelector('audio').stop();工作或 entity.pause() 但不工作。收到错误未捕获的类型错误:无法读取 null 的属性“暂停”
猜你喜欢
  • 2019-05-21
  • 1970-01-01
  • 2021-08-23
  • 2018-06-03
  • 2019-09-29
  • 2023-04-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多