{"id":4684,"url":"https://github.com/remobile/react-native-capture","last_synced_at":"2026-03-08T17:37:48.273Z","repository":{"id":57338318,"uuid":"46019980","full_name":"remobile/react-native-capture","owner":"remobile","description":null,"archived":false,"fork":false,"pushed_at":"2017-10-16T03:30:25.000Z","size":2260,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T09:17:48.818Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remobile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-12T00:55:34.000Z","updated_at":"2018-06-12T06:14:08.000Z","dependencies_parsed_at":"2022-08-31T06:00:32.468Z","dependency_job_id":null,"html_url":"https://github.com/remobile/react-native-capture","commit_stats":null,"previous_names":["remobile/react-native-media-capture"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remobile%2Freact-native-capture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remobile%2Freact-native-capture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remobile%2Freact-native-capture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remobile%2Freact-native-capture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remobile","download_url":"https://codeload.github.com/remobile/react-native-capture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248702857,"owners_count":21148115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:20.208Z","updated_at":"2026-03-08T17:37:48.232Z","avatar_url":"https://github.com/remobile.png","language":"Objective-C","funding_links":[],"categories":["Components"],"sub_categories":["Media"],"readme":"# React Native Capture (remobile)\nA cordova capture for react-native, support for ios and android\n\n## Installation\n```sh\nnpm install @remobile/react-native-capture --save\n```\n### Installation (iOS)\n* Drag RCTCapture.xcodeproj to your project on Xcode.\n* Click on your main project file (the one that represents the .xcodeproj) select Build Phases and drag libRCTCapture.a from the Products folder inside the RCTCapture.xcodeproj.\n* Look for Header Search Paths and make sure it contains both $(SRCROOT)/../../../react-native/React as recursive.\n\n### Installation (Android)\n```gradle\n...\ninclude ':react-native-capture'\nproject(':react-native-capture').projectDir = new File(settingsDir, '../node_modules/@remobile/react-native-capture/android')\n```\n\n* In `android/app/build.gradle`\n\n```gradle\n...\ndependencies {\n    ...\n    compile project(':react-native-capture')\n}\n```\n\n* register module (in MainApplication.java)\n\n```java\n......\nimport com.remobile.capture.RCTCapturePackage;  // \u003c--- import\n\n......\n\n@Override\nprotected List\u003cReactPackage\u003e getPackages() {\n   ......\n   new RCTCapturePackage(),            // \u003c------ add here\n   ......\n}\n\n```\n\n## Usage\n\n### Example\n```js\nvar React = require('react');\nvar ReactNative = require('react-native');\nvar {\n    StyleSheet,\n    View,\n    Image\n} = ReactNative;\n\nvar Capture = require('@remobile/react-native-capture');\nvar Button = require('@remobile/react-native-simple-button');\n\nmodule.exports = React.createClass({\n    getInitialState () {\n        return {\n            filePath: '',\n        };\n    },\n    taskVideo() {\n        Capture.captureVideo((mediaFiles)=\u003e{\n            let filePath = mediaFiles[0].fullPath;\n            this.setState({filePath});\n        }, ()=\u003e{\n            Toast('录制失败');\n        }, {limit:1});\n    },\n    render() {\n        const {filePath} = this.state;\n        return (\n            \u003cView style={styles.container}\u003e\n                \u003cButton onPress={this.taskVideo}\u003e摄像\u003c/Button\u003e\n                \u003cText\u003e{filePath}\u003c/Text\u003e\n            \u003c/View\u003e\n        );\n    },\n});\n\n\nvar styles = StyleSheet.create({\n    container: {\n        flex: 1,\n        justifyContent: 'space-around',\n        alignItems: 'center',\n        backgroundColor: 'transparent',\n    },\n});\n```\n\n### HELP\n* look https://github.com/apache/cordova-plugin-media-capture\n\n\n### thanks\n* this project come from https://github.com/apache/cordova-plugin-media-capture\n\n### see detail use\n* https://github.com/remobile/react-native-template\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremobile%2Freact-native-capture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremobile%2Freact-native-capture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremobile%2Freact-native-capture/lists"}