Aframe - 带声音的视频和 videospheres 不适用于 IOS

Aframe - Videos and videospheres with sound doesn't work on IOS

我已经尝试了post“https://github.com/aframevr/aframe/issues/316#issuecomment-170182397”和其他类似post中给出的所有解决方案,但其中none有效。

我想要的是当用户点击视频时播放有声视频。

我在下面创建了这个故障,但它只有在我将“静音”属性添加到视频标签时才有效。

https://glitch.com/~grey-acoustic-swordfish

你有什么办法解决这个问题吗?

Safari doesn't allow autoplay for videos with audio:

A element can use the play() method to automatically play without user gestures only when it contains no audio tracks or has its muted property set to true

如果您想要音频,您必须根据用户手势开始播放视频。我在下面的 2D 按钮处理程序中添加了 video.play()

<button onclick="playVideo();">Play Video</button>

function playVideo() {
  var vid = document.querySelector('#video');
  vid.muted = false;
  vid.play();
}

Modified example