{"action":"created","issue":{"url":"https://api.github.com/repos/react-native-community/react-native-camera/issues/1897","repository_url":"https://api.github.com/repos/react-native-community/react-native-camera","labels_url":"https://api.github.com/repos/react-native-community/react-native-camera/issues/1897/labels{/name}","comments_url":"https://api.github.com/repos/react-native-community/react-native-camera/issues/1897/comments","events_url":"https://api.github.com/repos/react-native-community/react-native-camera/issues/1897/events","html_url":"https://github.com/react-native-community/react-native-camera/issues/1897","id":376680978,"node_id":"MDU6SXNzdWUzNzY2ODA5Nzg=","number":1897,"title":"RNCamera [android] recordAsync method doesn't work","user":{"login":"zouminhuababa","id":26482360,"node_id":"MDQ6VXNlcjI2NDgyMzYw","avatar_url":"https://avatars3.githubusercontent.com/u/26482360?v=4","gravatar_id":"","url":"https://api.github.com/users/zouminhuababa","html_url":"https://github.com/zouminhuababa","followers_url":"https://api.github.com/users/zouminhuababa/followers","following_url":"https://api.github.com/users/zouminhuababa/following{/other_user}","gists_url":"https://api.github.com/users/zouminhuababa/gists{/gist_id}","starred_url":"https://api.github.com/users/zouminhuababa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zouminhuababa/subscriptions","organizations_url":"https://api.github.com/users/zouminhuababa/orgs","repos_url":"https://api.github.com/users/zouminhuababa/repos","events_url":"https://api.github.com/users/zouminhuababa/events{/privacy}","received_events_url":"https://api.github.com/users/zouminhuababa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-02T06:05:35Z","updated_at":"2018-11-17T15:15:17Z","closed_at":"2018-11-02T06:15:17Z","author_association":"NONE","body":"Related Modules\r\nRNCamera\r\n\r\nPlatforms\r\nAndroid\r\n\r\nVersions\r\n\r\nandroid:\r\nreact-native-camera: ^1.3.1\r\nreact-native: 0.57.4\r\nreact: 16.6.0-alpha.8af6728\r\n\r\nwhen i press record button i got this :\r\n\r\n Possible Unhandled Promise Rejection (id: 0):\r\nError: setAudioSource failed.\r\nError: setAudioSource failed.\r\n \r\nI have added all the necessary permissions。\r\n  <uses-permission android:name=\"android.permission.CAMERA\" />\r\n    <uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>\r\n    <uses-permission android:name=\"android.permission.RECORD_VIDEO\"/>\r\n    <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />\r\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\r\n\r\nmy code : \r\n\r\nimport React, { Component } from 'react';\r\nimport { StyleSheet, Text, TouchableOpacity, View } from 'react-native';\r\nimport { RNCamera } from 'react-native-camera';\r\n\r\nclass CameraRecordScreen extends Component {\r\n    constructor(props){\r\n        super(props);\r\n        this.state={\r\n            isFlashOn:false,\r\n            isRecording:false,\r\n        }\r\n\r\n    }\r\n\r\n    componentDidMount() {\r\n    };\r\n\r\n    render() {\r\n        return (\r\n            <View style={styles.container}>\r\n                <RNCamera\r\n                    ref={ref => {\r\n                        this.camera = ref;\r\n                    }}\r\n                    style={styles.preview}\r\n                    type={RNCamera.Constants.Type.back}\r\n                    flashMode={RNCamera.Constants.FlashMode.off}\r\n                    permissionDialogTitle={'Permission to use camera'}\r\n                    permissionDialogMessage={'We need your permission to use your camera phone'}\r\n                >\r\n                    <View style={{ flex: 0, flexDirection: 'row', justifyContent: 'center' }}>\r\n                        <View style={{position:'absolute',top:30,left:-40}} />\r\n                        {this.state.isRecording ?\r\n                            <TouchableOpacity\r\n                                onPress={this.stopRecord.bind(this)}\r\n                                style={styles.capture}>\r\n                                <Text style={{ fontSize: 14 }}> Stop </Text>\r\n                            </TouchableOpacity> :\r\n                            <TouchableOpacity\r\n                                onPress={this.takeRecord.bind(this)}\r\n                                style={styles.capture}>\r\n                                <Text style={{ fontSize: 14 }}> Record </Text>\r\n                            </TouchableOpacity>\r\n                        }\r\n                    </View>\r\n                </RNCamera>\r\n            </View>\r\n        );\r\n    }\r\n\r\n    takeRecord= async function(){\r\n        if (this.camera) {\r\n            this.setState({isRecording:true});\r\n            const options = { quality:RNCamera.Constants.VideoQuality[\"480p\"],maxFileSize:(100*1024*1024), maxDuration: 60 };\r\n            const data = await this.camera.recordAsync(options);\r\n            console.log('takeRecord data', data);\r\n        }\r\n    };\r\n\r\n    stopRecord = () => {\r\n        if (this.camera) {\r\n            this.setState({isRecording:false});\r\n            this.camera.stopRecording()\r\n        }\r\n    }\r\n}\r\n\r\nconst styles = StyleSheet.create({\r\n    container: {\r\n        flex: 1,\r\n        flexDirection: 'column',\r\n        backgroundColor: 'black',\r\n    },\r\n    preview: {\r\n        flex: 1,\r\n        justifyContent: 'flex-end',\r\n        alignItems: 'center',\r\n    },\r\n    capture: {\r\n        flex: 0,\r\n        backgroundColor: '#fff',\r\n        borderRadius: 5,\r\n        padding: 15,\r\n        paddingHorizontal: 20,\r\n        alignSelf: 'center',\r\n        margin: 20,\r\n    },\r\n});\r\n\r\nexport default CameraRecordScreen\r\n"},"comment":{"url":"https://api.github.com/repos/react-native-community/react-native-camera/issues/comments/439624398","html_url":"https://github.com/react-native-community/react-native-camera/issues/1897#issuecomment-439624398","issue_url":"https://api.github.com/repos/react-native-community/react-native-camera/issues/1897","id":439624398,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTYyNDM5OA==","user":{"login":"AlexSeoven","id":42401342,"node_id":"MDQ6VXNlcjQyNDAxMzQy","avatar_url":"https://avatars1.githubusercontent.com/u/42401342?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexSeoven","html_url":"https://github.com/AlexSeoven","followers_url":"https://api.github.com/users/AlexSeoven/followers","following_url":"https://api.github.com/users/AlexSeoven/following{/other_user}","gists_url":"https://api.github.com/users/AlexSeoven/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexSeoven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexSeoven/subscriptions","organizations_url":"https://api.github.com/users/AlexSeoven/orgs","repos_url":"https://api.github.com/users/AlexSeoven/repos","events_url":"https://api.github.com/users/AlexSeoven/events{/privacy}","received_events_url":"https://api.github.com/users/AlexSeoven/received_events","type":"User","site_admin":false},"created_at":"2018-11-17T15:15:17Z","updated_at":"2018-11-17T15:15:17Z","author_association":"NONE","body":"How do you solve your problem?"}}
{"actor":{"display_login":"AlexSeoven"}}