How to use the peerjs/lib/util.browser function in peerjs

To help you get started, we’ve selected a few peerjs 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 ouroboros-team / ouroboros / client / src / components / App.js View on Github external
import { Route, Switch } from 'react-router-dom';
import util from 'peerjs/lib/util';

import * as p2pActions from '../redux/p2p/p2pActionCreators';
import '../assets/styles/index.scss';

import Header from './Header';
import Game from './Game';
import Incompatible from './Incompatible';
import Help from './Help';
import Home from './Home';
import About from './About';

class App extends React.Component {
  state = {
    compatible: util.browser === 'Firefox',
  };

  componentDidMount() {
    if (this.state.compatible) {
      this.props.p2pInitialize();
    }
  }

  render() {
    let display;

    if (this.state.compatible) {
      display = ;
    } else {
      display = ;
    }

peerjs

PeerJS client

MIT
Latest version published 5 months ago

Package Health Score

86 / 100
Full package analysis