diff --git a/App.tsx b/App.tsx index 5575e1ac..3bbc33e5 100644 --- a/App.tsx +++ b/App.tsx @@ -11,8 +11,9 @@ import { queryClient } from './constants/query-client'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import TrackPlayer, { IOSCategory, IOSCategoryOptions } from 'react-native-track-player'; import { CAPABILITIES } from './player/constants'; +import { createWorkletRuntime } from 'react-native-reanimated'; -// export const backgroundRuntime = createWorkletRuntime('background'); +export const backgroundRuntime = createWorkletRuntime('background'); export default function App(): React.JSX.Element { @@ -51,7 +52,7 @@ export default function App(): React.JSX.Element { diff --git a/helpers/runtimeticks.ts b/helpers/runtimeticks.ts index 90b3d6eb..34a62ec9 100644 --- a/helpers/runtimeticks.ts +++ b/helpers/runtimeticks.ts @@ -1,4 +1,5 @@ // import { backgroundRuntime } from "@/App"; +import { backgroundRuntime } from "../App"; import { runOnRuntime } from "react-native-reanimated"; /** @@ -9,11 +10,11 @@ import { runOnRuntime } from "react-native-reanimated"; * @see https://emby.media/community/index.php?/topic/63357-runtimeticks-microseconds-milliseconds-or-nanoseconds/ */ export function convertSecondsToRunTimeTicks(seconds: number) { - // return runOnRuntime(backgroundRuntime, (runTimeSeconds: number) => { - const runTimeMilliseconds = seconds * 1000 * 10000; + return runOnRuntime(backgroundRuntime, (runTimeSeconds: number) => { + const runTimeMilliseconds = runTimeSeconds * 1000 * 10000; return runTimeMilliseconds; - // })(seconds); + })(seconds); } /** @@ -24,9 +25,9 @@ export function convertSecondsToRunTimeTicks(seconds: number) { * @see https://emby.media/community/index.php?/topic/63357-runtimeticks-microseconds-milliseconds-or-nanoseconds/ */ export function convertRunTimeTicksToSeconds(ticks: number) { - // return runOnRuntime(backgroundRuntime, (runTimeTicks : number) => { - const runTimeMilliseconds = ticks / 10000; + return runOnRuntime(backgroundRuntime, (runTimeTicks : number) => { + const runTimeMilliseconds = runTimeTicks / 10000; const runTimeTotalSeconds = Math.floor(runTimeMilliseconds / 1000); return runTimeTotalSeconds; - // })(ticks); + })(ticks); } \ No newline at end of file