Function requestFullscreen

  • Triggers a fullscreen request. Requires fullscreen support from the browser/device.

    Parameters

    • Optionalelement: Element

      the element to be set in full-screen mode.

    Returns void

    device

    // add a keyboard shortcut to toggle Fullscreen mode on/off
    me.input.bindKey(me.input.KEY.F, "toggleFullscreen");
    me.event.on(me.event.KEYDOWN, function (action, keyCode, edge) {
    // toggle fullscreen on/off
    if (action === "toggleFullscreen") {
    me.device.requestFullscreen();
    } else {
    me.device.exitFullscreen();
    }
    });