diff --git a/src/lib/FastImageSequence.ts b/src/lib/FastImageSequence.ts index 08bcbc2..c53228d 100644 --- a/src/lib/FastImageSequence.ts +++ b/src/lib/FastImageSequence.ts @@ -3,7 +3,7 @@ import Frame from "./Frame.js"; import {ImageFetchWorker} from "./ImageFetchWorker.js"; export function isMobile(): boolean { - return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); + return (typeof navigator !== "undefined" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)); } /**