@azzapp/react-native-skia-video
Version:
video support for react-native-skia
24 lines (21 loc) • 637 B
JavaScript
;
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