mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
Rename isMobile.js to platform.js
This commit is contained in:
parent
4f82b85d0c
commit
bec44f5ed0
2 changed files with 7 additions and 7 deletions
|
|
@ -4,11 +4,11 @@ const Bowser = require('bowser');
|
|||
|
||||
const browser = Bowser.parse(window.navigator?.userAgent || '');
|
||||
|
||||
const platform = (browser?.os?.name || 'unknown').toLowerCase();
|
||||
const name = (browser?.os?.name || 'unknown').toLowerCase();
|
||||
|
||||
module.exports = {
|
||||
platform,
|
||||
check: () => {
|
||||
return platform === 'ios' || platform === 'android';
|
||||
name,
|
||||
isMobile: () => {
|
||||
return name === 'ios' || name === 'android';
|
||||
}
|
||||
};
|
||||
|
|
@ -4,7 +4,7 @@ const React = require('react');
|
|||
const PropTypes = require('prop-types');
|
||||
const classnames = require('classnames');
|
||||
const Icon = require('@stremio/stremio-icons/dom');
|
||||
const { Button, Image, PlayIconCircleCentered, useProfile, isMobile, useStreamingServer } = require('stremio/common');
|
||||
const { Button, Image, PlayIconCircleCentered, useProfile, platform, useStreamingServer } = require('stremio/common');
|
||||
const StreamPlaceholder = require('./StreamPlaceholder');
|
||||
const styles = require('./styles');
|
||||
|
||||
|
|
@ -15,8 +15,8 @@ const Stream = ({ className, addonName, name, description, thumbnail, progress,
|
|||
const href = React.useMemo(() => {
|
||||
return deepLinks ?
|
||||
profile.settings.playerType === 'external' ?
|
||||
isMobile.check() || !haveStreamingServer ?
|
||||
deepLinks.externalPlayer.vlc[isMobile.platform] || deepLinks.externalPlayer.streaming
|
||||
platform.isMobile() || !haveStreamingServer ?
|
||||
deepLinks.externalPlayer.vlc[platform.name] || deepLinks.externalPlayer.streaming
|
||||
: 'javascript:void(0);' // handled in StreamsList.js onClick
|
||||
:
|
||||
typeof deepLinks.player === 'string' ?
|
||||
|
|
|
|||
Loading…
Reference in a new issue