React-VR iFrame Fullscreen

Creating the React-VR application that I need for iFrame into an existing application. My question is about the full screen button. How can I either hide this button and control it in my other application, or send a message to my parents that the button is pressed?

+4
source share
1 answer

Could not find the official documentation for this, but if you look at the implementation VRInstance, you will notice hideFullscreenwhich hides this button.

// vr/client.js
const vr = new VRInstance(bundle, 'VRTEST', parent, {
  hideFullscreen: true,
  ...options,
});

iframe, , screenfull.js, - API.

DOM .

const vrIframe = document.getElementById('vrIframe');

document.getElementById('vrFullscreenButton').addEventListener('click', () => {
  if (screenfull.enabled) {
    screenfull.request(vrIframe);
  }
});
+3

Source: https://habr.com/ru/post/1680110/


All Articles