forked from akai/readest
Loop silent audio to unblock iOS web audio in silent mode (#223)
This commit is contained in:
@@ -40,11 +40,11 @@ export const getUserLocale = (lang: string): string | undefined => {
|
||||
export const getOSPlatform = () => {
|
||||
const userAgent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if (/iphone|ipad|ipod/.test(userAgent)) return 'ios';
|
||||
if (userAgent.includes('android')) return 'android';
|
||||
if (userAgent.includes('macintosh') || userAgent.includes('mac os x')) return 'macos';
|
||||
if (userAgent.includes('windows nt')) return 'windows';
|
||||
if (userAgent.includes('linux')) return 'linux';
|
||||
if (/iphone|ipad|ipod/.test(userAgent)) return 'ios';
|
||||
if (userAgent.includes('android')) return 'android';
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user