✨(frontend) add utils to determine user's browser
Copied from LiveKit utils functions. Using LiveKit client, determine whether the user's browser is Safari, chromium based, or firefox.
This commit is contained in:
committed by
aleb_the_flash
parent
88fadd1d61
commit
74b296aa37
@@ -1,5 +1,17 @@
|
|||||||
import { LogLevel, setLogLevel } from 'livekit-client'
|
import { getBrowser, LogLevel, setLogLevel } from 'livekit-client'
|
||||||
|
|
||||||
export const silenceLiveKitLogs = (shouldSilenceLogs: boolean) => {
|
export const silenceLiveKitLogs = (shouldSilenceLogs: boolean) => {
|
||||||
setLogLevel(shouldSilenceLogs ? LogLevel.silent : LogLevel.debug)
|
setLogLevel(shouldSilenceLogs ? LogLevel.silent : LogLevel.debug)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isFireFox(): boolean {
|
||||||
|
return getBrowser()?.name === 'Firefox'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isChromiumBased(): boolean {
|
||||||
|
return getBrowser()?.name === 'Chrome'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isSafari(): boolean {
|
||||||
|
return getBrowser()?.name === 'Safari'
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user