Aframe 和 aframe-ar:在 div 中显示视频流而不是全屏 [英] Aframe and aframe-ar: display video stream in div instead of fullscreen

查看:19
本文介绍了Aframe 和 aframe-ar:在 div 中显示视频流而不是全屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 aframe-ar 并且需要将视频流显示在与嵌入场景相同的 div 中.

I am using aframe-ar and need the video stream to be displayed in the same div as the scene is embedded to.

我正在尝试使用默认场景:

I am trying with the default scene:

<a-scene embedded arjs='sourceType: webcam; debugUIEnabled: false;'>
 <a-marker preset="hiro">
  <a-box position='0 0.5 0' material='color: black;'></a-box>
 </a-marker>
</a-scene>

渲染的框成功嵌入到周围的 div 中,但我的网络摄像头的视频流是全屏的,并位于其他 html 元素后面.

The rendered box is successfully embedded in the surrounding div, but the video stream of my webcam is fullscreen and placed behind other html-elements.

我也尝试明确指定相机,但没有帮助!

I also tried to specify the camera explicitly but that did not help!

简而言之:我想让视频也嵌入到周围的 div 中.

In short: I want to get the video also embedded in the surrounding div.

  • A-Frame 版本:0.8.0
  • 平台/设备:Chrome/台式机

我该怎么做?

推荐答案

ar.js 在整个 body 元素上传播相机源.如果您不想弄乱源代码,您可以将其包含在 iframe 中:

ar.js spreads the camera feed on the entire body element. If you don't want to mess with the source code, You can contain it within an iframe:

<iframe src="myScene.html"></iframe>

工作故障此处.

这篇关于Aframe 和 aframe-ar:在 div 中显示视频流而不是全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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