WeibelLab-Teaching / CSE_218_118_Fa20_Team_SRSLy_Joking

1 stars 0 forks source link

Improve walking functionality #31

Closed tlsharkey closed 3 years ago

tlsharkey commented 4 years ago

Current walking functionality is very limited and only works for one video. This needs to be improved upon to use the users 'momentum'

tlsharkey commented 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.

siueric0010 commented 3 years ago

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?

tlsharkey commented 3 years ago

Pushed to ticket-31_Improved-Walking Check scripts/main.js line 180-196 in that branch (the addStream(uri) function)

tlsharkey commented 3 years ago

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