Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display loading content before presentation without subsequent user interaction #315

Closed
jsantell opened this issue Jan 8, 2018 · 3 comments

Comments

@jsantell
Copy link
Contributor

jsantell commented Jan 8, 2018

In the CardboardVRDisplay used in the webvr-polyfill, when entering VR, a div is displayed temporarily, prompting the user to put the device into a cardboard headset. Behind the scenes, the document has requested fullscreen (via user activation), and the stereoscopic rendering begins after device rotation to landscape, or a few seconds. Since it's not using a native WebVR API, the stereoscopic can display anytime after the rotate instructions is removed.

Some current users of the polyfill overload this loading screen with their own content, but that wouldn't work on any native platforms. In the latest spec, it's only possible to create a new session via user activation. The user activation details say it can support subsequent commands from user activation ("4 seconds" being ok, where "4 hours" is not, understandably). Would this support the ability to display monoscopic content on the host display while lazily beginning the stereoscopic experience?

window.addEventListener('click', () => {
  displayCustomDiv();
  setTimeout(() => xrDevice.requestSession(), 4000);
});

Or would it be best handled in storing the session during initial user activation, but lazily begin requesting/drawing frames? Seems like this should work on external XRDevices, but less confident on mobile devices like Daydream or GearVR.

let session;
window.addEventListener('click', async function() {
  displayCustomDiv();
  session = await xrDevice.requestSession();
  setTimeout(() => session.requestAnimationFrame(animate), 4000);
});

function animate() {
  // render with XRDevice
  session.requestAnimationFrame(animate);
}

Discussion in CardboardVRDisplay with regard to how to support this interstitial: immersive-web/webvr-polyfill#292 (comment)

@toji
Copy link
Member

toji commented Jan 10, 2018

To be clear, there's two issues at play here: One is that regardless of whether or not the developers wants to show a custom splash or the system displays a splash itself, there's the potential for a significant delay between the original user activation event and the point that the VR content actually begins displaying, which would traditionally make it impossible to, say, wait until the user is full in VR to begin playing media. I thought we had something to account for this in the explainer but that appears to not be the case. I'll file a separate issue for it.

The second issue, of developers wanting to show custom 2D UI prior to entering VR, is one that I'm not sure how I feel about and would like to understand the context more. What type of content do we anticipate developers wanting to show here? If it's simply instructions on how to prepare the system for VR viewing (like placing a phone in a harness) I feel strongly that should be left to the user agent. Especially because in some cases it's not skippable (like with Daydream) or nonsensical (I'm already browsing in VR). In those situations any instructions given by the developer will either be redundant, doubling up on the amount of time users have to wait to get into VR as two unskippable screens show, or unnecessary. (User: "Yes, random VR site. I know you want me to put the phone into the headset. I'm already in VR and I'm on a PC. You can go 😡 off now.") This screen works specifically in the context of the polyfill because we know that it only applies to mobile devices being used with a cardboard-like viewer.

But maybe I'm missing the reason that devs want the interstitial? What are some of the use cases?

@jsantell
Copy link
Contributor Author

cc @jeppester

@toji
Copy link
Member

toji commented May 24, 2018

For the sake of reducing the number of active issues on this repo, closing this due to lack of additional feedback. The media playback problem has it's own issue and the Cardboard splash image isn't something that I believe we should be supporting.

@toji toji closed this as completed May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants