Closed tlsharkey closed 3 years ago
@siueric0010 for the videos in WebXR, I have them spawning in a <div>
:
<div id="streams" style="display:none">
<video src="assets/samplevid.mp4" crossorigin="anonymous" autoplay="" loop="" playsinline=""></video>
<video src="assets/samplevid.mp4" crossorigin="anonymous" autoplay="" loop="" playsinline=""></video>
<video src="assets/samplevid.mp4" crossorigin="anonymous" autoplay="" loop="" playsinline=""></video>
<video src="assets/samplevid.mp4" crossorigin="anonymous" autoplay="" loop="" playsinline=""></video>
<video src="assets/samplevid.mp4" crossorigin="anonymous" autoplay="" loop="" playsinline=""></video>
</div>
where src
can be anything that will render to a <video>
. I believe the XR display just grabs whatever is rendered on the <video>
and displays it - it isn't trying to access the stream.
Hmm, I can try it on my branch and see if it works. In the sample code, all it does is create a new video element and append it to a div. If we can just format the div, it would make it easy to append streams. When will you be pushing this html code?
Pushed to ticket-31_Improved-Walking
Check scripts/main.js line 180-196 in that branch (the addStream(uri)
function)
If WebRTC is spawning the video elements that should be fine. Is there a listener/callback? We can easily just change addStream(uri)
to respond to a callback:
WebRTC.onStreamConnected(addStream)
...
function addStream() {
videos = document.getElementById("Streams").getElementsByTagName("video")
new_video = videos[videos.length-1]
...
}
kind of thing
Current walking functionality is very limited and only works for one video. This needs to be improved upon to use the users 'momentum'