stash icon indicating copy to clipboard operation
stash copied to clipboard

[Feature] Support immersive VR video from browser with webXR

Open TaakoMagnusen opened this issue 7 months ago • 6 comments

Is your feature request related to a problem? Please describe.

It seems that videojs-vr does not support immersive VR, it only supports projection of the VR format videos onto a 2D surface that you can pan around with click+drag. This means devices using the browser to view stash videos cannot watch the video in VR.

When I go to the website for webXR on my Apple Vision Pro (Safari) and Android (Brave Browser) devices and click "Enter VR" on the demo on that page a popup comes on both devices asking to enter immersive mode, and when i click to allow it enters VR uses the devices gyro to direct the camera.

After finding out the difference between videojs-vr and webXR i googled around to see if someoen combined them and sure enough i found this: https://github.com/thomasdeppisch/videojs-xr

When i go to the demo from that github and click the little goggle icon on my Apple Vision Pro it does launch the immersive mode!

So it seems like to get the vr video player to actually function with immersive video Stash needs to integrate the videojs-xr. It seems really easy to integrate so i'll make a feature request :slight_smile:

Describe the solution you'd like Add videojs-xr integration to the videojs-vr player for videos tagged for Virtual Reality. This will enable VR-capable devices to watch VR video directly from the browser! This would provide expanded VR support for tons of devies, everything from Google Cardboard and GearVR to Apple Vision Pro. Any device that implements the webXR standard can use it to send the device gryo data to videojs-xr to control the camera.

Describe alternatives you've considered Right now the only alternative is to use something like Stash-VR which only supports a couple applications and none of them are on Apple Vision Pro.

TaakoMagnusen avatar Sep 04 '25 03:09 TaakoMagnusen

Correct me if i'm wrong (i'm a firmware dev, not a webdev guy) but from a cursory glance it seems like all that's needed is to import the videojs-xr library after videojs-vr in this file

ui/v2.5/src/components/ScenePlayer/vrmode.ts

then instead of this.vr = this.player.vr(); on line 126 you can do this.vr = this.player.xr();

might be more complex though as this was just a quick code search based on the guidelines from the videojs-xr page

TaakoMagnusen avatar Sep 04 '25 04:09 TaakoMagnusen

actually i wonder if this function is causing issues too

function isVrDevice() {
  return navigator.userAgent.match(/oculusbrowser|\svr\s/i);
}

this feels like a very narrow match for VR devices

TaakoMagnusen avatar Sep 04 '25 04:09 TaakoMagnusen

Any luck with getting a modified version compiled?

DocFreeman avatar Oct 12 '25 15:10 DocFreeman

@TaakoMagnusen Any luck with this?

Apple Vision Pro support is sorely lacking in general, but I was hoping there would be enough AVP users along with users of other immersive tech that we'd have a simple solution for immersive browser playback by now, but it doesn't seem to be on anyone's roadmap.

DabsSamurai avatar Nov 09 '25 23:11 DabsSamurai

I'm happy to help test etc on AVP now :) @DabsSamurai

U343ksare21 avatar Nov 15 '25 06:11 U343ksare21

Not sure if I'm missing something but does the AVP not give you the option to enter into a given projection mode by choice? With my Quest, I've always had VR videos display in the player window (on all websites). I just go fullscreen then switch projection mode. In Stash, I just queue scenes up so I don't need to leave the immersive view.

HarletKing avatar Dec 10 '25 15:12 HarletKing