Skip to content

Commit

Permalink
feat: Prevent Screen Capture
Browse files Browse the repository at this point in the history
  • Loading branch information
fahimalizain committed Feb 6, 2024
1 parent f090699 commit f644f17
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion audire/audire-mobile-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"@xstate/react": "*",
"react-native-tab-view": "*",
"react-native-reanimated": "*",
"@react-navigation/drawer": "*"
"@react-navigation/drawer": "*",
"expo-screen-capture": "*"
},
"scripts": {
"eas-build-pre-install": "cd ../../ && node tools/scripts/eas-build-pre-install.mjs . audire/audire-mobile-app && cp package-lock.json audire/audire-mobile-app",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ import {
import * as ScreenOrientation from 'expo-screen-orientation';
import React, { ComponentProps, FC, useEffect, useRef, useState } from 'react';
import { Platform } from 'react-native';
import { usePreventScreenCapture } from 'expo-screen-capture';

type VideoComponentProps = ComponentProps<typeof Box> & {
r2Key: string;
};

const VideoComponent: FC<VideoComponentProps> = (props) => {
usePreventScreenCapture();

const videoRef = useRef<Video>(null);
const [url, setUrl] = useState<string | null>(null);
const { trigger: getURL } = useR2Download();
Expand Down
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"tslib": "^2.3.0",
"xstate": "^5.4.1",
"zod": "^3.22.4",
"zod-validation-error": "^2.1.0"
"zod-validation-error": "^2.1.0",
"expo-screen-capture": "~5.3.0"
},
"devDependencies": {
"@babel/core": "^7.14.5",
Expand Down

0 comments on commit f644f17

Please sign in to comment.