Aframe 如何在a帧中循环播放第一次启动后的下一个声音?

Aframe 如何在a帧中循环播放第一次启动后的下一个声音?,aframe,Aframe,如何在a帧中循环播放第一次启动后的下一个声音? 动画不起作用 <a-sky src="#room" sound="src:#soundstart; autoplay:true; loop:false" rotation="0 300 0" animation="property:sound.src; to:#soundfon; autoplay:true; delay:5000; loop:true"></a-sky> 这似乎是自定义a形框架组件的工作: 播放第一个声音

如何在a帧中循环播放第一次启动后的下一个声音? 动画不起作用

<a-sky src="#room" sound="src:#soundstart; autoplay:true; loop:false" rotation="0 300 0" animation="property:sound.src; to:#soundfon; autoplay:true; delay:5000; loop:true"></a-sky>

这似乎是自定义a形框架组件的工作:

播放第一个声音 等到它完成 播放第二个声音。 假设您有如下设置:

<a-entity manager></a-entity>
<a-box id="first" sound="src: url(sound1.mp3);"></a-box>
<a-box id="second" sound="src: url(sound2.mp3);"></a-box>

中查看第一个声音播放完毕后,是否要播放第二个声音?是的!如何做?使用动画,我可以使用延迟启动第二个声音吗?
AFRAME.registerComponent('manager', {
  init: function() {
     // grab the boxes
     let first = document.querySelector("#first")
     let second = document.querySelector("#second")

     // play the first sound
     first.components.sound.playSound();

     // wait for it to end
     first.addEventListener("sound-ended", function() {
       // play the second one     
       second.components.sound.playSound();
     })
  }
}