react-native-record-screen
A screen record module for React Native.
Sorry...Android dont't support yet.(It will be supported soon.)
Installation
npm install react-native-record-screen
add info.pilot
<key>NSCameraUsageDescription</key>
<string>Please allow use of camera</string>
pod install
cd ios && pod install && cd ../
Usage
Recording full screen
import RecordScreen from 'react-native-record-screen';
RecordScreen.startRecording().catch((error) => console.error(error));
const res = await RecordScreen.stopRecording().catch((error) =>
console.warn(error)
);
if (res) {
const url = res.result.outputURL;
}
Croped screen
RecordScreen.setup({
crop: {
width: Dimensions.get('window').width,
height: Dimensions.get('window').height - 180,
x: 0,
y: 80,
fps: 24,
},
});
RecordScreen.startRecording().catch((error) => console.error(error));
const res = await RecordScreen.stopRecording().catch((error) =>
console.error(error)
);
if (res) {
const url = res.result.outputURL;
}
or
RecordScreen.startRecording({
crop: {
width: Dimensions.get('window').width,
height: Dimensions.get('window').height - 180,
x: 0,
y: 80,
fps: 24,
},
}).catch((error) => console.error(error));
const res = await RecordScreen.stopRecording().catch((error) =>
console.warn(error)
);
if (res) {
const url = res.result.outputURL;
}
Clean Sandbox
RecordScreen.clean();
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT