How to use the screenfull.isEnabled 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 colejd / guify / src / menu-bar.js View on Github external
}

        // Make the menu collapse button
        let menuButton = this.element.appendChild(document.createElement('button'));
        menuButton.className = styles['guify-bar-button'];
        menuButton.innerHTML = 'Controls';
        css(menuButton, {
            left: opts.align == 'left' ? '0' : 'unset',
            right: opts.align == 'left' ? 'unset' : '0',
        })
        menuButton.onclick = () => {
            this.emit('ontogglepanel');
        }

        // Make the fullscreen button
        if (screenfull.isEnabled) {
            let fullscreenButton = this.element.appendChild(document.createElement('button'));
            fullscreenButton.className = styles['guify-bar-button'];
            fullscreenButton.innerHTML = '「 」';
            fullscreenButton.setAttribute('aria-label', 'Toggle Fullscreen');
            css(fullscreenButton, {
                left: opts.align == 'left' ? 'unset' : '0', // Place on opposite side from menuButton
                right: opts.align == 'left' ? '0' : 'unset',
            })
            fullscreenButton.onclick = () => {
                this.emit('onfullscreenrequested');
            }
        }

    }
github mschipperheyn / screenfull-react / src / index.js View on Github external
return () => {
      if (screenfull.isEnabled) {
        screenfull.exit();
      }
      const node = getNode();
      if (node) {
        node.removeEventListener("scroll", handleScroll);
      }
    };
  }, []);
github vortesnail / qier-player / src / component / controls / index.js View on Github external
requestFullScreen() {
    const videoElem = this.props.videoContainerRef.current;
    if (this.state.isScreentFull) {
      screenfull.exit();
    } else {
      if (screenfull.isEnabled) {
        setTimeout(() => {
          this.props.controllerContainerRef.current.style.width =
            "calc(100vw - 2px)";
          this.props.controllerContainerRef.current.style.height =
            "calc(100vh - 2px)";
          this.props.progressAndControlsWrapRef.current.style.width = "100vw";
        }, 100);
        screenfull.request(videoElem);
      } else {
        alert("Sorry, present video can't fullscreen.");
      }
    }
  }
github microblink / microblink-js / src / ui / index.js View on Github external
openFullscreen() {
      let root = this.shadowRoot.querySelector('.root'); //for now remove fullscreen option for firefox mobile
      return this.fullscreen && screenfull && screenfull.isEnabled && !(isMobile() && isFirefox()) ? screenfull.request(root) : Promise.resolve(false);
    }
github bhj / karaoke-forever / src / components / Header / PlaybackCtrl / PlaybackCtrl.js View on Github external
const handleFullscreen = () => {
  if (screenfull.isEnabled) {
    const el = document.getElementById('player-fs-container')
    screenfull.request(el)
  }
}
github ltadpoles / react-admin / src / views / Index / Index.jsx View on Github external
fullToggle = () => {
        if (screenfull.isEnabled) {
            screenfull.request(document.getElementById('bar'))
        }
    }
    render() {
github xmlking / ngx-starter-kit / libs / toolbar / src / lib / components / fullscreen-toggle / fullscreen-toggle.component.ts View on Github external
toggleFullscreen() {
    if (screenfull.isEnabled) {
      screenfull.toggle();
      this.isFullscreen = !this.isFullscreen;
    }
  }
}
github flipped-aurora / gin-vue-admin / web / src / view / layout / screenfull / index.vue View on Github external
mounted() {
    if (screenfull.isEnabled) {
      screenfull.on('change', this.changeFullShow)
    }
  },
  methods: {
github peer-calls / peer-calls / src / client / components / Toolbar.tsx View on Github external
handleFullscreenClick = () => {
    if (screenfull.isEnabled) {
      screenfull.toggle()
    }
  }
  handleHangoutClick = () => {