mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 10:42:12 +00:00
Improve isMobile API
This commit is contained in:
parent
c9347885e0
commit
4f82b85d0c
2 changed files with 9 additions and 6 deletions
|
|
@ -4,8 +4,11 @@ const Bowser = require('bowser');
|
|||
|
||||
const browser = Bowser.parse(window.navigator?.userAgent || '');
|
||||
|
||||
module.exports = () => {
|
||||
if (browser?.os?.name === 'iOS') return 'ios';
|
||||
if (browser?.os?.name === 'Android') return 'android';
|
||||
return false;
|
||||
const platform = (browser?.os?.name || 'unknown').toLowerCase();
|
||||
|
||||
module.exports = {
|
||||
platform,
|
||||
check: () => {
|
||||
return platform === 'ios' || platform === 'android';
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ const Stream = ({ className, addonName, name, description, thumbnail, progress,
|
|||
const href = React.useMemo(() => {
|
||||
return deepLinks ?
|
||||
profile.settings.playerType === 'external' ?
|
||||
isMobile() || !haveStreamingServer ?
|
||||
deepLinks.externalPlayer.vlc[isMobile()] || deepLinks.externalPlayer.streaming
|
||||
isMobile.check() || !haveStreamingServer ?
|
||||
deepLinks.externalPlayer.vlc[isMobile.platform] || deepLinks.externalPlayer.streaming
|
||||
: 'javascript:void(0);' // handled in StreamsList.js onClick
|
||||
:
|
||||
typeof deepLinks.player === 'string' ?
|
||||
|
|
|
|||
Loading…
Reference in a new issue