videojs / videojs-vr

A plugin to add 360 and VR video support to video.js.
https://videojs-vr.netlify.com/
MIT License
541 stars 144 forks source link

Non 360 examples are not working when run locally #256

Open dmitriy-baltak opened 3 years ago

dmitriy-baltak commented 3 years ago

Hi guys, I'm trying to run examples of videojs-vr implementation from examples folder of the repo by running npm run build-prod && npm run server and accessing http://localhost:9999/ but unfortunately none of the examples are working except those that have 360 projection, all other examples fail with this error:

video.js:249 VIDEOJS: ERROR: TypeError: Cannot read properties of undefined (reading '0')
    at VR.changeProjection_ (videojs-vr.js:48939)
    at VR.init (videojs-vr.js:49298)
    at HTMLDivElement.data.dispatcher (video.js:2353)
    at trigger (video.js:2489)
    at Player.trigger$1 [as trigger] (video.js:3430)
    at Player.<computed> [as handleTechLoadedmetadata_] (video.js:29583)
    at Player.<anonymous> (video.js:25474)
    at HTMLVideoElement.data.dispatcher (video.js:2353)

Any idea what I might be missing here?

The reason why I was trying to run them in the first place is that I have similar issue when I try to use plugin on my website, but instead of error for non 360 projection videos I have just a back canvas with timeline running but nothing changing on canvas.

Also important to note that all of the examples on https://videojs-vr.netlify.app/ are actually working fine for me, so that's quite confusing.

dmitriy-baltak commented 3 years ago

The issue seems to be related to the fact that Threejs changed it's api and videojs-vr is still using old one. It's trying to use faceVertexUvs as an array, when a correct way of doing it is getAttribute( 'uv' ). There might be more issues, but unfortunately I had a limited time to look into it.

Btw, https://videojs-vr.netlify.app/ is using older version of videojs-vr (1.7.2)

ruhowe commented 1 year ago

Ah, I see. This is helpful to explain why only 360 sphere works.