How to use the screenfull.request function in screenfull

To help you get started, we’ve selected a few screenfull examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github qti3e / slye / frontend / editor.tsx View on Github external
this.presentation.focus();
      // Setup orbit control.
      const { x, y, z } = this.presentation.getCurrentStep().getPosition();
      this.orbitControl.enabled = true;
      this.orbitControl.target.set(x, y, z);
    } else {
      selectedComponent = undefined;
      this.presentation.blur();
    }

    if (mode === EditorMode.PLAY) {
      this.presentation.play();
      this.orbitControl.enabled = false;
      this.transformControl.enabled = false;
      this.transformControl.detach();
      if (Screenfull) Screenfull.request(this.presentation.domElement);
      this.presentation.resize(window.innerWidth, window.innerHeight);
    } else if (this.state.mode === EditorMode.PLAY) {
      if (Screenfull) Screenfull.exit();
    }

    this.setState({
      mode,
      selectedComponent
    });
  }
github googlearchive / webvr-ui / src / webvr-manager.js View on Github external
enterFullscreen(canvas) {
    if (screenfull.enabled) {
      screenfull.request(canvas);
    } else {
      // iOS
      this.__setState(State.PRESENTING_FULLSCREEN);
    }
    return true;
  }
github speedlazer / speedlazer / app / index.js View on Github external
$(document).on('click', '#cr-stage', function () {
  if (screenfull.enabled) {
    screenfull.request($('#theater')[0]);
    $('body').addClass('fullscreen');
    scaleGame();
    document.addEventListener(screenfull.raw.fullscreenchange, function () {
      if (!screenfull.isFullscreen) {
        // exit fullscreen code here
        $('body').removeClass('fullscreen');
        scaleGame();
      }
    });
  }
});
github ging / ediphy / plugins / EnrichedPDF / components / EnrichedPDFPlugin.js View on Github external
onClickFullscreen() {
        if(!this.state.fullscreen) {
            screenfull.request(findDOMNode(this.pdf_wrapper));
        } else {
            screenfull.exit();
        }
        this.setState({ fullscreen: !this.state.fullscreen });
    }
github mozilla / hubs / src / utils / fullscreen.js View on Github external
export function showFullScreenIfWasFullScreen() {
  if (hasEnteredFullScreenThisSession && !screenfull.isFullscreen) {
    screenfull.request();
  }
}
github Prisma-care / mobile-app / src / app / storyList / component / storyDetail / storyDetail.component.ts View on Github external
this.album = this.navParams.get('album') as Album;
    this.story = this.navParams.get('story') as Story;
    this.backgroundImage = this.sanitizer.bypassSecurityTrustUrl(
      this.story.backgroundImage
    );
    if (this.story.type === 'youtube') {
      this.source = this.sanitizer.bypassSecurityTrustResourceUrl(
        this.story.source
      );
      this.setYoutubeUrl(this.story.source);
      this.showControls = true;
    } else {
      this.showControls = false;
    }
    if (screenfull.enabled) {
      screenfull.request();
    }
  }
github HearthSim / Joust / ts / components / GameWidget.tsx View on Github external
public enterFullscreen(): void {
		if (!this.state.isFullscreenAvailable) {
			return;
		}
		screenfull.request(this.ref);
	}
github googlearchive / webvr-ui / src / Enter360Button.js View on Github external
enterFullscreen() {
        if(screenfull.enabled){
            screenfull.request(this.sourceCanvas);
            this.__setState(State.PRESENTING);
            return true;
        }
        return false;
    };
github u-wave / web / src / components / Video / index.js View on Github external
const handleRequestFullscreenEnter = useCallback(() => {
    if (screenfull.enabled) {
      screenfull.request(container.current);
    }
    onFullscreenEnter();
  }, [onFullscreenEnter]);