Photo Sphere Viewer with webcam support.
Use the Insta360 X4 as a webcam with the Photo Sphere Viewer.
This repo modifies the Equirectangular Video example to add access to Webcam or Desktop live video.
2 files are modified. The Equirectangular adapter and Video Plug-in are needed to complete this mod.
-
The psv_live.html file adds a request to Get User Media and adds a Video Element to the page body.
-
In the node_modules/@photo-sphere-viewer/equirectangular-video-adapter/index.module.js file modify the loadTexture() function
return this.__videoLoadPromise(video).then(() => {
//swap video with User Media (Camera or Desktop Capture)
video = document.getElementById("camera");
const texture = new VideoTexture(video);
return { panorama, texture };