yutasuzuki / react-native-record-screen

react-native-record-screen
MIT License
149 stars 40 forks source link

video not stop #48

Closed Poojamok closed 3 years ago

Poojamok commented 3 years ago

the library is working fine till last day but today when I am using this library in app it show me everything ok but when i am stop recording it shows me nothing nor video recording file getting or no error, please help me.

yasirwahid commented 3 years ago

@Poojamok have you find any solution? i have the same issue. it was working fine and now stop recording is not returning anything.

elburu commented 3 years ago

hi @Poojamok and @yasirwahid, same here!!!, do you found any solution?

yasirwahid commented 3 years ago

@elburu Sorry buddy, i couldnt reproduce the issue since then it worked automatically and returned data. im still not sure whats wrong.

Poojamok commented 3 years ago

@Poojamok have you find any solution? i have the same issue. it was working fine and now stop recording is not returning anything.

hii, buddy yes i have solve my problem, but i have forget how? I am using following sdk for build.gradle

buildToolsVersion = "29.0.3" minSdkVersion = 26 compileSdkVersion = 29 targetSdkVersion = 29 ndkVersion = "20.1.5948944"

and following code:

import React, { Component } from 'react'; import { StyleSheet, View, Text, Dimensions, StatusBar, SafeAreaView, ScrollView, TouchableHighlight, Button, } from 'react-native'; import RecordScreen from 'react-native-record-screen'; import {RNCamera} from 'react-native-camera';

const width = Dimensions.get('window').width; const height = Math.floor((Dimensions.get('window').height - 150) / 3);

class RecordScreen extends Component { state = { uri: '', recording:false, };

handleOnRecording = async () =>{ if (this.state.recording) { this.setState({recording:false}); const res = await RecordScreen.stopRecording().catch((error) => console.warn(error) ); console.log('res', res); if (res) { this.setState({uri:res.result.outputURL}); } } else { this.setState({uri:''}); this.setState({recording:true}); await RecordScreen.startRecording().catch((error) => { console.warn(error); this.setState({recording:false}); this.setState({uri:''}); }); } };

render() { return (

); } } const styles = StyleSheet.create({ main: { flex: 1, }, btnContainer: { height: 50, alignItems: 'center', justifyContent: 'flex-start', backgroundColor: 'transparent', }, btnWrapper: { alignItems: 'center', justifyContent: 'center', width: 50, height: 50, backgroundColor: '#fff', borderRadius: 30, }, btnDefault: { width: 48, height: 48, backgroundColor: '#fff', borderRadius: 24, borderWidth: 4, borderStyle: 'solid', borderColor: '#68a0cf', }, btnActive: { width: 36, height: 36, backgroundColor: 'red', borderRadius: 8, }, recordingMark: { backgroundColor: 'red', paddingVertical: 6, paddingHorizontal: 16, marginBottom: 10, borderRadius: 24, }, recordingMarkText: { fontSize: 14, fontWeight: 'bold', color: '#fff', }, textShadow: { textShadowColor: 'red', textShadowOffset: { width: 2, height: 2 }, textShadowRadius : 5 } }); export default RecordScreen; and reinstall library. thank you
yasirwahid commented 3 years ago

@Poojamok the library run sometimes and sometimes it doesnt return anything. my target SDK version is 31 ad i cant downgrade it. and im pretty sure there is nothing wrong on javascript side. Thanks anyways.