为什么我的视频或videosphere无法在A-Frame VR中的移动设备上播放? [英] Why is my video or videosphere not playing on mobile in A-Frame VR?

查看:303
本文介绍了为什么我的视频或videosphere无法在A-Frame VR中的移动设备上播放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有视频或视频球的A帧场景:

I have an A-Frame scene with a video or videosphere:

<a-scene>
  <a-assets>
    <video id="video" src="anothervideo.mp4></video>
  </a-assets>
  <a-video src="myvideo.mp4></a-video>
  <a-videosphere src="#video></a-videosphere>
</a-scene>

当我在iOS或Android上进行测试时,我只会看到黑屏,它可以在桌面上运行。

When I test in iOS or Android, I just see a black screen. It works on desktop.

推荐答案

检查 https:// aframe.io/faq/#why-does-myes-video-not-on-mobile-play-


iOS Safari有关视频限制的文档: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/ uid / TP40009523-CH5-SW1

移动浏览器具有局限性ns 并显示嵌入式视频。 2D移动网络不太适合播放嵌入式视频。由于iOS平台的限制,要获取嵌入式视频(有或没有自动播放),我们必须:

Mobile browsers have limitations with displaying inline video. The 2D mobile web is not very suited for playing inline videos. Because of an iOS platform restriction in order to get inline video (with or without autoplay), we must:


  • 设置元标记( A-Frame)。

  • 将webkit-playsinline属性设置为video元素。 (在iOS 10上,仅重命名为 playsinline

  • 将网页固定到iOS主屏幕。

以及在某些Android设备或浏览器上:

And on certain Android devices or browsers:


  • 用户交互以触发视频(例如,听点击/点击)。您可以点击Enter VR按钮。

通过所有这些步骤,您应该为用户提供说明和UI

With all of these steps, you should provide instructions and UI to the user for the necessary steps to get mobile video playing (pin-to-homescreen, tap).

我们将尝试提供解决这些情况的完整示例。

We will try to have a complete example out that addresses these cases.

他们还记录一次只能播放一个视频,并且格式/编解码器受到限制:

They also document that only one video can play at a time, and there are restrictions on the format/codecs:

Safari on iOS supports low-complexity AAC audio, MP3 audio, AIF audio, WAVE audio, and baseline profile MPEG-4 video. Safari on the desktop (Mac OS X and Windows) supports all media supported by the installed version of QuickTime, including any installed third-party codecs.

iOS Safari最近宣布支持下一版本的嵌入式视频,但我们将必须等着看结果如何。

这篇关于为什么我的视频或videosphere无法在A-Frame VR中的移动设备上播放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆