UNPKG

@azzapp/react-native-skia-video

Version:
24 lines (21 loc) 637 B
"use strict"; import { createWorkletRuntime, runOnRuntime } from 'react-native-reanimated'; import { Platform } from 'react-native'; import RNSkiaVideoModule from '../RNSkiaVideoModule'; const isAndroid = Platform.OS === 'android'; const runOnNewThread = fn => { const exportRuntime = createWorkletRuntime('RNSkiaVideoExportRuntime-' + performance.now()); runOnRuntime(exportRuntime, () => { 'worklet'; if (isAndroid) { RNSkiaVideoModule.runWithJNIClassLoader?.(() => { 'worklet'; fn(); }); } else { fn(); } })(); }; export { runOnNewThread }; //# sourceMappingURL=thread.js.map