Aframe Videosphere如何检测视频结束

Aframe Videosphere how to detect end of video

我正在尝试在第一个视频播放完毕后直接播放另一个视频。

有没有办法检测第一个视频的结尾?

视频节点发出 endedpaused 等事件。 您可以查看它们 here


也就是说,您可以创建一个组件,它将监听事件:

AFRAME.registerComponent("foo", {
 init: function() {
   var vid = document.querySelector("#myVideo")
   vid.addEventListener("ended", (e) => {
     //change the sphere material + play the new video
   }
})