How to use the platform.name function in platform

To help you get started, we’ve selected a few platform 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 OpenVidu / openvidu / openvidu-browser / lib / OpenVidu / Session.js View on Github external
_this.processToken(token);
            if (_this.openvidu.checkSystemRequirements()) {
                // Early configuration to deactivate automatic subscription to streams
                _this.options = {
                    sessionId: _this.sessionId,
                    participantId: token,
                    metadata: !!metadata ? _this.stringClientMetadata(metadata) : ''
                };
                _this.connectAux(token).then(function () {
                    resolve();
                })["catch"](function (error) {
                    reject(error);
                });
            }
            else {
                reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.BROWSER_NOT_SUPPORTED, 'Browser ' + platform.name + ' for ' + platform.os.family + ' is not supported in OpenVidu'));
            }
        });
    };
github OpenVidu / openvidu / openvidu-browser / lib / OpenViduInternal / WebRtcStats / WebRtcStats.js View on Github external
WebRtcStats.prototype.getStatsAgnostic = function (pc, successCb, failureCb) {
        var _this = this;
        if (platform.name.indexOf('Firefox') !== -1) {
            // getStats takes args in different order in Chrome and Firefox
            return pc.getStats(null).then(function (response) {
                var report = _this.standardizeReport(response);
                successCb(report);
            })["catch"](failureCb);
        }
        else if ((platform.name.indexOf('Chrome') !== -1) || (platform.name.indexOf('Opera') !== -1)) {
            // In Chrome, the first two arguments are reversed
            return pc.getStats(function (response) {
                var report = _this.standardizeReport(response);
                successCb(report);
            }, null, failureCb);
        }
    };
    return WebRtcStats;
github webiny / webiny-js / packages-client / webiny-client / src / core / Lib / Logger.js View on Github external
getClientInfo() {
        return {
            date: new Date(),
            browserName: platform.name,
            osName: platform.os.name,
            screenWidth: window.screen.availWidth,
            screenHeight: window.screen.availHeight
        };
    }
github kryptco / kr-u2f / src / krpairing.ts View on Github external
public static async generateAndSave(): Promise {
        const pairing = new Pairing();
        pairing.creationTimestamp = Date.now();
        pairing.version = VERSION;
        pairing.workstationDeviceIdentifier = await Pairing.getDeviceIdentifier();
        pairing.workstationName = platform.name + ' ' + platform.os.family;
        pairing.keyPair = await crypto_box_keypair();

        await pairing.save();
        createQueues(pairing);
        return pairing;
    }
github yinxin630 / fiora / client / main.js View on Github external
async function guest() {
    const [err, res] = await fetch('guest', {
        os: platform.os.family,
        browser: platform.name,
        environment: platform.description,
    });
    if (!err) {
        action.setGuest(res);
    }
}
github MyEtherWallet / MyEtherWallet / src / layouts / AccessWalletLayout / components / Web3WalletModal / Web3WalletModal.vue View on Github external
this.$refs.metamask.$on('shown', () => {
      this.isSafari = platform.name.toLowerCase() === 'safari';
    });
  },
github wireapp / wire-webapp / src / script / util / Environment.ts View on Github external
const _isChrome = (): boolean => platform.name === BROWSER_NAME.CHROME || _isElectron();
const _isDesktop = (): boolean => _isElectron() && platform.ua.includes(BROWSER_NAME.WIRE);
github promethe42 / cocorico / app / src / script / mixin / ForceBrowserCompatibility.jsx View on Github external
componentWillMount: function() {
    var supported = ConfigStore.getConfig().supportedWebBrowsers;
    var name = platform.name.toLowerCase();

    if (!(name in supported)
            || this._compareVersion(platform.version, supported[name].version) < 0) {
      this.render = this.renderUnsupportedWebBrowserDialog;
    }
  },
github GlobalFishingWatch / map-client / app / src / components / App.jsx View on Github external
render() {
    const isWebGLSupported = PIXI.utils.isWebGLSupported();
    const isEdge = platform.name.match(/edge/gi) !== null;

    const showBanner =
      (
        isWebGLSupported === false ||
        isEdge === true ||
        this.props.legacyWorkspaceLoaded ||
        this.props.hasDeprecatedActivityLayersMessage !== null ||
        (SHOW_BANNER === true && this.props.banner !== undefined)
      )
      && this.state.bannerDismissed === false
      && window.innerWidth > 768;

    let bannerContent;
    if (SHOW_BANNER === true) bannerContent = this.props.banner;
    else if (isWebGLSupported === false) bannerContent = this.props.bannerWebGL;
    else if (this.props.legacyWorkspaceLoaded === true) bannerContent = this.props.bannerLegacyWorkspace;