Comments (5)
A recent release introduced the <Video>
tag, which allows you to do all of the things requested above.
https://facebook.github.io/react-vr/docs/video.html
from react-360.
Yes you would need to do it on the native side, either in client.js
or in a Native Module. Both audio and 2D video support are highly requested features that are in active development.
from react-360.
Thanks @amberroy ! Right now I successfully created a HTML5 video, then applied to a THREE.VideoTexture
and added to the scene in client.js
and managed to created a very simple VideoModule
boilerplate to handle play()
, pause()
and so on. The thing is that while it works fine and web and I could reuse the mesh when playing a new video in the scene (supposing i'm only playing one video at any given moment) it doesn't work properly on mobile because the VRButton
's onClick
who is issuing the play()
and pause()
methods is not bubbling correctly to the VideoModule, giving me the following DOMException
: Uncaught (in promise) DOMException: play() can only be initiated by a user gesture.
To clarify, i'm initializing VideoModule this way: VideoModule.init(video, mesh)
, video
being the HTML5 and the THREE mesh
, and the VideoModule.play()
just does video.play()
, same thing with pause()
. So my current workflow for playing a video is:
client.js
: Creates HTML5 video
, a VideoTexture
and the mesh
, both added to scene
and then initialized in VideoModule.init(video, mesh)
index.vr.js
: VRButton.onClick
=> _handleVideo()
=> VideoModule.play()
Any ideas on why this might happen? Thank you!
from react-360.
The problem is the limitation of the browsers. As the message states, it needs a user gesture to start a video. It is the same problem as with enabling fullscreen.
In VR the click handling is purely handled by javascript and so the browser can't root the event to a user gesture and fails to play the video.
One solution would be to catch the event which triggers the vr mode and use this to play all videos in the scene and pause them instantly. The resume of the video shouldn't be bound to a user gesture.
Unfortunately it would be not possible to add videos later. So for a more complex scene this use case it not suited.
from react-360.
@Ninerian you mean the "View in VR" button? That's a good suggestion, i'm going to try it right now. I'll post the result here. Thanks
from react-360.
Related Issues (20)
- How to read cursor position
- react 360 is not working in windows whlie using node.12.14.1 and react16.3.1 HOT 4
- How to add a simple static button over react-360?
- how can I exactly create 360 video with react 360? HOT 1
- I can use the device camera as background with React-360?
- Creating a gitter or discord server for the open source contributors.
- how to run the dev server on windows ?
- Is it possible to make an effect as if a viewer is moving around the space? HOT 1
- Maintained? HOT 9
- Environment.setBackground gives an error
- It's possible to pass `-h` as a folder name
- starting issue HOT 4
- React-360 Camera Movement on Mobile Devices HOT 1
- render pano image by layers
- If you're going to revoke patents, at least remove it from the README HOT 1
- Can we add popup window to screenspace instead of world space? HOT 1
- Using document object or jquery inside react 360 component HOT 1
- Model animations load and play
- unable to run react vr http://localhost:8081/vr/ HOT 3
- React360 is incompatible with Oculus Quest HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-360.