Request fullscreen on Chromium with raspberry pi touchscreen

  • I'm using Construct 3 to make certain applications for the raspberry pi 3B+ and an official 7" raspberry pi touchscreen. The apps run on Chromium, a linux port of Chrome.

    One of the apps requires me to go into fullscreen, but the touchscreen is not allowed to push the 'fullscreen button', neither is chromium allowing to go fullscreen on the start of the layout.

    It is however allowed to go fullscreen when a mouse presses the button that triggers the fullscreen event.

    After some research, it appears that this is a security measurement so ads and malicious popups could not fake a screen by going fullscreen on touchevents.

    Error when trying to go fullscreen on start of layout:

    c2runtime.js:29345 Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.[/code:wm36dakz]
    Error when trying to go fullscreen 'on touch'':
    [code:wm36dakz]c2runtime.js:29277 Fullscreen request failed:  Event {isTrusted: true, type: "webkitfullscreenerror", target: html, currentTarget: html, eventPhase: 2, …}bubbles: truecancelBubble: falsecancelable: falsecomposed: falsecurrentTarget: nulldefaultPrevented: falseeventPhase: 0isTrusted: truepath: (3) [html, document, Window]0: html1: document2: Window {stop: ƒ, open: ƒ, alert: ƒ, confirm: ƒ, prompt: ƒ, …}length: 3__proto__: Array(0)returnValue: truesrcElement: htmltarget: htmltimeStamp: 48660.825000000004type: "webkitfullscreenerror"__proto__: Event
    onFullscreenError  c2runtime.js:29277[/code:wm36dakz]
    
    Any idea how I could work around this (in construct 3)? I know going fullscreen with a mouse is possible, but the setup of my app has the purpose to be touchscreen only.
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)