├── .gitignore ├── .travis.yml ├── README.md ├── frontend ├── android │ ├── .project │ └── app │ │ ├── .project │ │ └── bin │ │ └── .project └── node_modules │ ├── react-native-camera │ └── android │ │ ├── .project │ │ └── bin │ │ └── .project │ └── react-native-video │ └── android │ ├── .project │ └── bin │ └── .project ├── streaming ├── .gitignore ├── backend │ ├── .dockerignore │ ├── .gitignore │ ├── Dockerfile │ ├── demo.html │ ├── index.js │ ├── package-lock.json │ └── package.json ├── frontend │ ├── .babelrc │ ├── .buckconfig │ ├── .flowconfig │ ├── .gitattributes │ ├── .gitignore │ ├── .watchmanconfig │ ├── android │ │ ├── app │ │ │ ├── BUCK │ │ │ ├── bin │ │ │ │ ├── build.gradle │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ ├── assets │ │ │ │ │ └── fonts │ │ │ │ │ │ ├── Entypo.ttf │ │ │ │ │ │ ├── EvilIcons.ttf │ │ │ │ │ │ ├── Feather.ttf │ │ │ │ │ │ ├── FontAwesome.ttf │ │ │ │ │ │ ├── Foundation.ttf │ │ │ │ │ │ ├── Ionicons.ttf │ │ │ │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ │ │ ├── Octicons.ttf │ │ │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ │ │ └── Zocial.ttf │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── frontend │ │ │ │ │ │ ├── MainActivity.class │ │ │ │ │ │ └── MainApplication.class │ │ │ │ │ └── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ └── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── assets │ │ │ │ └── fonts │ │ │ │ │ ├── Entypo.ttf │ │ │ │ │ ├── EvilIcons.ttf │ │ │ │ │ ├── Feather.ttf │ │ │ │ │ ├── FontAwesome.ttf │ │ │ │ │ ├── Foundation.ttf │ │ │ │ │ ├── Ionicons.ttf │ │ │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ │ ├── Octicons.ttf │ │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ │ └── Zocial.ttf │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── frontend │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── MainApplication.java │ │ │ │ └── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── keystores │ │ │ ├── BUCK │ │ │ └── debug.keystore.properties │ │ └── settings.gradle │ ├── app.json │ ├── index.js │ ├── ios │ │ ├── frontend-tvOS │ │ │ └── Info.plist │ │ ├── frontend-tvOSTests │ │ │ └── Info.plist │ │ ├── frontend.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ ├── frontend-tvOS.xcscheme │ │ │ │ └── frontend.xcscheme │ │ ├── frontend │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Base.lproj │ │ │ │ └── LaunchScreen.xib │ │ │ ├── Images.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── Info.plist │ │ │ └── main.m │ │ └── frontendTests │ │ │ ├── Info.plist │ │ │ └── frontendTests.m │ ├── package-lock.json │ ├── package.json │ ├── patches │ │ ├── react-native-camera+1.1.4.patch │ │ └── react-native-fetch-blob+0.10.8.patch │ ├── src │ │ ├── App.js │ │ ├── Config.js │ │ ├── RecordVideo.js │ │ └── VideoOverview.js │ └── yarn.lock └── react-native-video-upload.postman_collection.json └── videos ├── .gitignore ├── backend ├── .dockerignore ├── .gitignore ├── Dockerfile ├── demo.html ├── index.js ├── package-lock.json └── package.json ├── frontend ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── android │ ├── app │ │ ├── BUCK │ │ ├── bin │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── assets │ │ │ │ └── fonts │ │ │ │ │ ├── Entypo.ttf │ │ │ │ │ ├── EvilIcons.ttf │ │ │ │ │ ├── Feather.ttf │ │ │ │ │ ├── FontAwesome.ttf │ │ │ │ │ ├── Foundation.ttf │ │ │ │ │ ├── Ionicons.ttf │ │ │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ │ ├── Octicons.ttf │ │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ │ └── Zocial.ttf │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── frontend │ │ │ │ │ ├── MainActivity.class │ │ │ │ │ └── MainApplication.class │ │ │ │ └── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── fonts │ │ │ │ ├── Entypo.ttf │ │ │ │ ├── EvilIcons.ttf │ │ │ │ ├── Feather.ttf │ │ │ │ ├── FontAwesome.ttf │ │ │ │ ├── Foundation.ttf │ │ │ │ ├── Ionicons.ttf │ │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ ├── Octicons.ttf │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ └── Zocial.ttf │ │ │ ├── java │ │ │ └── com │ │ │ │ └── frontend │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── app.json ├── index.js ├── ios │ ├── frontend-tvOS │ │ └── Info.plist │ ├── frontend-tvOSTests │ │ └── Info.plist │ ├── frontend.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── frontend-tvOS.xcscheme │ │ │ └── frontend.xcscheme │ ├── frontend │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── frontendTests │ │ ├── Info.plist │ │ └── frontendTests.m ├── package-lock.json ├── package.json ├── src │ ├── App.js │ ├── Config.js │ ├── RecordVideo.js │ └── VideoOverview.js └── yarn.lock └── react-native-video-upload.postman_collection.json /.gitignore: -------------------------------------------------------------------------------- 1 | ../../.vscode/ 2 | android/app/.classpath 3 | ../../videos/frontend/android/.settings/ 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | services: 4 | - docker 5 | 6 | matrix: 7 | include: 8 | - script: 9 | - docker build -t $DOCKER_USERNAME/react-native-video-upload-demo-backend ./video/backend 10 | - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" 11 | - docker push $DOCKER_USERNAME/react-native-video-upload-demo-backend -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native Video Upload Demo 2 | 3 | This is a project demoing how to upload videos to a node express web server. 4 | 5 | ## Status 6 | 7 | ### In `videos/` 8 | 9 | - [x] Video Uploading 10 | - [x] Backend 11 | - [x] Frontend 12 | - [x] Stream Download 13 | - [x] [Backend](https://medium.com/@daspinola/video-stream-with-node-js-and-html5-320b3191a6b6) 14 | - [x] Frontend 15 | 16 | 17 | ### In `streams/` 18 | 19 | - [ ] Stream Upload 20 | - [ ] Backend 21 | - [ ] Frontend 22 | - [ ] Subscribe to currently being uploaded streams 23 | - [ ] Backend 24 | - [ ] Frontend 25 | -------------------------------------------------------------------------------- /frontend/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | frontend 4 | Project frontend created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /frontend/android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /frontend/android/app/bin/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /frontend/node_modules/react-native-camera/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | react-native-camera 4 | Project react-native-camera created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /frontend/node_modules/react-native-camera/android/bin/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | react-native-camera 4 | Project react-native-camera created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /frontend/node_modules/react-native-video/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | react-native-video 4 | Project react-native-video created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /frontend/node_modules/react-native-video/android/bin/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | react-native-video 4 | Project react-native-video created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /streaming/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ -------------------------------------------------------------------------------- /streaming/backend/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /streaming/backend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | uploads 3 | 4 | -------------------------------------------------------------------------------- /streaming/backend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:10 2 | 3 | ADD package*.json ./ 4 | RUN npm install 5 | 6 | ADD . . 7 | 8 | EXPOSE 3000 9 | ENTRYPOINT [ "npm", "start" ] -------------------------------------------------------------------------------- /streaming/backend/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /streaming/backend/index.js: -------------------------------------------------------------------------------- 1 | // The source for most of this backend is at https://scotch.io/tutorials/express-file-uploads-with-multer 2 | const express = require("express"); 3 | const multer = require("multer"); 4 | const cors = require("cors"); 5 | const Loki = require("lokijs"); 6 | const fs = require("fs"); 7 | const path = require("path"); 8 | 9 | const PORT = process.env.PORT || 3000; 10 | const DB_NAME = (process.env.DB_NAME || "db") + ".json"; 11 | const UPLOAD_PATH = process.env.UPLOAD_PATH || "uploads"; 12 | const COLUMN_NAME = process.env.COLUMN_NAME || "images"; 13 | 14 | const upload = multer({ dest: `${UPLOAD_PATH}/` }); 15 | const db = new Loki(`${UPLOAD_PATH}/${DB_NAME}`, { persistenceMethod: "fs" }); 16 | 17 | const app = express(); 18 | require("express-ws")(app); 19 | app.use(cors()); 20 | 21 | function loadCollection(colName, db) { 22 | return new Promise(resolve => { 23 | db.loadDatabase({}, () => { 24 | const _collection = 25 | db.getCollection(colName) || db.addCollection(colName); 26 | resolve(_collection); 27 | }); 28 | }); 29 | } 30 | 31 | app.post("/", upload.single("video"), async (req, res) => { 32 | console.log("POST /"); 33 | 34 | try { 35 | const col = await loadCollection(COLUMN_NAME, db); 36 | const data = col.insert(req.file); 37 | db.saveDatabase(); 38 | 39 | res 40 | .send({ 41 | id: data.$loki, 42 | fileName: data.filename, 43 | originalName: data.originalname 44 | }) 45 | .end(); 46 | } catch (err) { 47 | console.error(err); 48 | res.sendStatus(500).end(); 49 | } 50 | }); 51 | 52 | app.ws("/", function(ws) { 53 | let data = ""; 54 | 55 | ws.on("message", function(msg) { 56 | data += msg; 57 | }); 58 | 59 | ws.on("close", async function close() { 60 | const col = await loadCollection(COLUMN_NAME, db); 61 | col.insert(data); 62 | db.saveDatabase(); 63 | }); 64 | }); 65 | 66 | app.get("/", async (req, res) => { 67 | console.log("GET /"); 68 | const col = await loadCollection(COLUMN_NAME, db); 69 | 70 | res 71 | .json(col.data.map(entry => ({ id: entry["$loki"], path: entry.path }))) 72 | .end(); 73 | }); 74 | 75 | app.get("/:id", async (req, res) => { 76 | console.log("GET /", req.params.id); 77 | try { 78 | const col = await loadCollection(COLUMN_NAME, db); 79 | const result = col.get(req.params.id); 80 | 81 | if (!result) { 82 | res.sendStatus(404); 83 | return; 84 | } 85 | 86 | // Tutorial on streaming: https://medium.com/@daspinola/video-stream-with-node-js-and-html5-320b3191a6b6 87 | // Prepare sending the request 88 | const filePath = path.join(UPLOAD_PATH, result.filename); 89 | const headers = { 90 | "Content-Type": result.mimetype 91 | }; 92 | const stat = fs.statSync(filePath); 93 | const fileSize = stat.size; 94 | const range = req.headers.range; 95 | 96 | if (range) { 97 | const parts = range.replace(/bytes=/, "").split("-"); 98 | const start = parseInt(parts[0], 10); 99 | const end = parts[1] ? parseInt(parts[1], 10) : fileSize - 1; 100 | const chunksize = end - start + 1; 101 | const file = fs.createReadStream(filePath, { start, end }); 102 | 103 | res.writeHead(206, { 104 | ...headers, 105 | "Content-Range": `bytes ${start}-${end}/${fileSize}`, 106 | "Accept-Ranges": "bytes", 107 | "Content-Length": chunksize 108 | }); 109 | file.pipe(res); 110 | } else { 111 | const head = { 112 | "Content-Length": fileSize, 113 | "Content-Type": "video/mp4" 114 | }; 115 | res.writeHead(200, head); 116 | fs.createReadStream(filePath).pipe(res); 117 | } 118 | } catch (err) { 119 | console.log(err); 120 | res.sendStatus(400); 121 | } 122 | }); 123 | 124 | app.listen(PORT, () => { 125 | console.log("Server started on port", PORT); 126 | }); 127 | -------------------------------------------------------------------------------- /streaming/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-video-upload-backend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "watch": "nodemon index.js", 8 | "start": "node index.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "cors": "^2.8.4", 14 | "express": "^4.16.3", 15 | "express-ws": "^4.0.0", 16 | "lokijs": "^1.5.5", 17 | "multer": "^1.3.0" 18 | }, 19 | "devDependencies": { 20 | "nodemon": "^1.17.5" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /streaming/frontend/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /streaming/frontend/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /streaming/frontend/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | ; Ignore metro 20 | .*/node_modules/metro/.* 21 | 22 | [include] 23 | 24 | [libs] 25 | node_modules/react-native/Libraries/react-native/react-native-interface.js 26 | node_modules/react-native/flow/ 27 | node_modules/react-native/flow-github/ 28 | 29 | [options] 30 | emoji=true 31 | 32 | module.system=haste 33 | 34 | munge_underscores=true 35 | 36 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 37 | 38 | module.file_ext=.js 39 | module.file_ext=.jsx 40 | module.file_ext=.json 41 | module.file_ext=.native.js 42 | 43 | suppress_type=$FlowIssue 44 | suppress_type=$FlowFixMe 45 | suppress_type=$FlowFixMeProps 46 | suppress_type=$FlowFixMeState 47 | 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 49 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 50 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 51 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 52 | 53 | [version] 54 | ^0.67.0 55 | -------------------------------------------------------------------------------- /streaming/frontend/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /streaming/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .settings 3 | .vscode 4 | # OSX 5 | # 6 | .DS_Store 7 | 8 | # Xcode 9 | # 10 | build/ 11 | *.pbxuser 12 | !default.pbxuser 13 | *.mode1v3 14 | !default.mode1v3 15 | *.mode2v3 16 | !default.mode2v3 17 | *.perspectivev3 18 | !default.perspectivev3 19 | xcuserdata 20 | *.xccheckout 21 | *.moved-aside 22 | DerivedData 23 | *.hmap 24 | *.ipa 25 | *.xcuserstate 26 | project.xcworkspace 27 | 28 | # Android/IntelliJ 29 | # 30 | build/ 31 | .idea 32 | .gradle 33 | local.properties 34 | *.iml 35 | 36 | # node.js 37 | # 38 | node_modules/ 39 | npm-debug.log 40 | yarn-error.log 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | *.keystore 46 | 47 | # fastlane 48 | # 49 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 50 | # screenshots whenever they are needed. 51 | # For more information about the recommended setup visit: 52 | # https://docs.fastlane.tools/best-practices/source-control/ 53 | 54 | */fastlane/report.xml 55 | */fastlane/Preview.html 56 | */fastlane/screenshots 57 | 58 | # Bundle artifact 59 | *.jsbundle 60 | -------------------------------------------------------------------------------- /streaming/frontend/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /streaming/frontend/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.frontend", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.frontend", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | project.ext.react = [ 76 | entryFile: "index.js" 77 | ] 78 | 79 | apply from: "../../node_modules/react-native/react.gradle" 80 | 81 | /** 82 | * Set this to true to create two separate APKs instead of one: 83 | * - An APK that only works on ARM devices 84 | * - An APK that only works on x86 devices 85 | * The advantage is the size of the APK is reduced by about 4MB. 86 | * Upload all the APKs to the Play Store and people will download 87 | * the correct one based on the CPU architecture of their device. 88 | */ 89 | def enableSeparateBuildPerCPUArchitecture = false 90 | 91 | /** 92 | * Run Proguard to shrink the Java bytecode in release builds. 93 | */ 94 | def enableProguardInReleaseBuilds = false 95 | 96 | android { 97 | compileSdkVersion 27 98 | buildToolsVersion "27.0.0" 99 | 100 | defaultConfig { 101 | applicationId "com.frontend" 102 | minSdkVersion 16 103 | targetSdkVersion 22 104 | versionCode 1 105 | versionName "1.0" 106 | ndk { 107 | abiFilters "armeabi-v7a", "x86" 108 | } 109 | } 110 | splits { 111 | abi { 112 | reset() 113 | enable enableSeparateBuildPerCPUArchitecture 114 | universalApk false // If true, also generate a universal APK 115 | include "armeabi-v7a", "x86" 116 | } 117 | } 118 | buildTypes { 119 | release { 120 | minifyEnabled enableProguardInReleaseBuilds 121 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 122 | } 123 | } 124 | // applicationVariants are e.g. debug, release 125 | applicationVariants.all { variant -> 126 | variant.outputs.each { output -> 127 | // For each separate APK per architecture, set a unique version code as described here: 128 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 129 | def versionCodes = ["armeabi-v7a":1, "x86":2] 130 | def abi = output.getFilter(OutputFile.ABI) 131 | if (abi != null) { // null for the universal-debug, universal-release variants 132 | output.versionCodeOverride = 133 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 134 | } 135 | } 136 | } 137 | } 138 | 139 | dependencies { 140 | compile project(':react-native-camera') 141 | compile fileTree(dir: "libs", include: ["*.jar"]) 142 | compile "com.android.support:appcompat-v7:23.0.1" 143 | compile "com.facebook.react:react-native:+" // From node_modules 144 | } 145 | 146 | // Run this once to be able to run the application with BUCK 147 | // puts all compile dependencies into folder libs for BUCK to use 148 | task copyDownloadableDepsToLibs(type: Copy) { 149 | from configurations.compile 150 | into 'libs' 151 | } 152 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/java/com/frontend/MainActivity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/java/com/frontend/MainActivity.class -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/java/com/frontend/MainApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/java/com/frontend/MainApplication.class -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/bin/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | frontend 3 | 4 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/bin/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | project.ext.react = [ 76 | entryFile: "index.js" 77 | ] 78 | 79 | apply from: "../../node_modules/react-native/react.gradle" 80 | 81 | /** 82 | * Set this to true to create two separate APKs instead of one: 83 | * - An APK that only works on ARM devices 84 | * - An APK that only works on x86 devices 85 | * The advantage is the size of the APK is reduced by about 4MB. 86 | * Upload all the APKs to the Play Store and people will download 87 | * the correct one based on the CPU architecture of their device. 88 | */ 89 | def enableSeparateBuildPerCPUArchitecture = false 90 | 91 | /** 92 | * Run Proguard to shrink the Java bytecode in release builds. 93 | */ 94 | def enableProguardInReleaseBuilds = false 95 | 96 | android { 97 | compileSdkVersion 27 98 | buildToolsVersion "27.0.0" 99 | 100 | defaultConfig { 101 | applicationId "com.frontend" 102 | minSdkVersion 16 103 | targetSdkVersion 22 104 | versionCode 1 105 | versionName "1.0" 106 | ndk { 107 | abiFilters "armeabi-v7a", "x86" 108 | } 109 | } 110 | splits { 111 | abi { 112 | reset() 113 | enable enableSeparateBuildPerCPUArchitecture 114 | universalApk false // If true, also generate a universal APK 115 | include "armeabi-v7a", "x86" 116 | } 117 | } 118 | buildTypes { 119 | release { 120 | minifyEnabled enableProguardInReleaseBuilds 121 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 122 | } 123 | } 124 | // applicationVariants are e.g. debug, release 125 | applicationVariants.all { variant -> 126 | variant.outputs.each { output -> 127 | // For each separate APK per architecture, set a unique version code as described here: 128 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 129 | def versionCodes = ["armeabi-v7a":1, "x86":2] 130 | def abi = output.getFilter(OutputFile.ABI) 131 | if (abi != null) { // null for the universal-debug, universal-release variants 132 | output.versionCodeOverride = 133 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 134 | } 135 | } 136 | } 137 | } 138 | 139 | dependencies { 140 | compile project(':react-native-fetch-blob') 141 | compile project(':react-native-file-utils') 142 | compile project(':react-native-fs') 143 | compile project(':react-native-camera') 144 | compile fileTree(dir: "libs", include: ["*.jar"]) 145 | compile "com.android.support:appcompat-v7:23.0.1" 146 | compile "com.facebook.react:react-native:+" // From node_modules 147 | } 148 | 149 | // Run this once to be able to run the application with BUCK 150 | // puts all compile dependencies into folder libs for BUCK to use 151 | task copyDownloadableDepsToLibs(type: Copy) { 152 | from configurations.compile 153 | into 'libs' 154 | } 155 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/java/com/frontend/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.frontend; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "frontend"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/java/com/frontend/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.frontend; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.RNFetchBlob.RNFetchBlobPackage; 7 | import com.anumang.rnfileutils.RNFUPackage; 8 | import com.rnfs.RNFSPackage; 9 | import org.reactnative.camera.RNCameraPackage; 10 | import com.facebook.react.ReactNativeHost; 11 | import com.facebook.react.ReactPackage; 12 | import com.facebook.react.shell.MainReactPackage; 13 | import com.facebook.soloader.SoLoader; 14 | 15 | import java.util.Arrays; 16 | import java.util.List; 17 | 18 | public class MainApplication extends Application implements ReactApplication { 19 | 20 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 21 | @Override 22 | public boolean getUseDeveloperSupport() { 23 | return BuildConfig.DEBUG; 24 | } 25 | 26 | @Override 27 | protected List getPackages() { 28 | return Arrays.asList( 29 | new MainReactPackage(), 30 | new RNFetchBlobPackage(), 31 | new RNFUPackage(), 32 | new RNFSPackage(), 33 | new RNCameraPackage() 34 | ); 35 | } 36 | 37 | @Override 38 | protected String getJSMainModuleName() { 39 | return "index"; 40 | } 41 | }; 42 | 43 | @Override 44 | public ReactNativeHost getReactNativeHost() { 45 | return mReactNativeHost; 46 | } 47 | 48 | @Override 49 | public void onCreate() { 50 | super.onCreate(); 51 | SoLoader.init(this, /* native exopackage */ false); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | frontend 3 | 4 | -------------------------------------------------------------------------------- /streaming/frontend/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /streaming/frontend/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | google() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.0.1' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | mavenLocal() 19 | jcenter() 20 | maven { 21 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 22 | url "$rootDir/../node_modules/react-native/android" 23 | } 24 | google() 25 | } 26 | } 27 | 28 | subprojects { 29 | project.configurations.all { 30 | resolutionStrategy.eachDependency { details -> 31 | if (details.requested.group == 'com.android.support' 32 | && !details.requested.name.contains('multidex') ) { 33 | details.useVersion "27.1.0" 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /streaming/frontend/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /streaming/frontend/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/streaming/frontend/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /streaming/frontend/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 6 | -------------------------------------------------------------------------------- /streaming/frontend/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /streaming/frontend/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /streaming/frontend/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /streaming/frontend/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /streaming/frontend/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'frontend' 2 | include ':react-native-fetch-blob' 3 | project(':react-native-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fetch-blob/android') 4 | include ':react-native-file-utils' 5 | project(':react-native-file-utils').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-file-utils/android') 6 | include ':react-native-fs' 7 | project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android') 8 | include ':react-native-camera' 9 | project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android') 10 | 11 | include ':app' 12 | -------------------------------------------------------------------------------- /streaming/frontend/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "displayName": "frontend" 4 | } -------------------------------------------------------------------------------- /streaming/frontend/index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from "react-native"; 2 | import App from "./src/App"; 3 | 4 | AppRegistry.registerComponent("frontend", () => App); 5 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend.xcodeproj/xcshareddata/xcschemes/frontend-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend.xcodeproj/xcshareddata/xcschemes/frontend.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | @interface AppDelegate : UIResponder 11 | 12 | @property (nonatomic, strong) UIWindow *window; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | NSURL *jsCodeLocation; 18 | 19 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 20 | 21 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 22 | moduleName:@"frontend" 23 | initialProperties:nil 24 | launchOptions:launchOptions]; 25 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 26 | 27 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 28 | UIViewController *rootViewController = [UIViewController new]; 29 | rootViewController.view = rootView; 30 | self.window.rootViewController = rootViewController; 31 | [self.window makeKeyAndVisible]; 32 | return YES; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | frontend 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | NSCameraUsageDescription 30 | Lets start a video 31 | 32 | 33 | NSPhotoLibraryUsageDescription 34 | Lets start a video 35 | 36 | 37 | NSMicrophoneUsageDescription 38 | Lets start a video 39 | UIRequiredDeviceCapabilities 40 | 41 | armv7 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | NSLocationWhenInUseUsageDescription 52 | 53 | NSAppTransportSecurity 54 | 55 | 56 | NSExceptionDomains 57 | 58 | localhost 59 | 60 | NSExceptionAllowsInsecureHTTPLoads 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontend/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontendTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /streaming/frontend/ios/frontendTests/frontendTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | #import 12 | #import 13 | 14 | #define TIMEOUT_SECONDS 600 15 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 16 | 17 | @interface frontendTests : XCTestCase 18 | 19 | @end 20 | 21 | @implementation frontendTests 22 | 23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 24 | { 25 | if (test(view)) { 26 | return YES; 27 | } 28 | for (UIView *subview in [view subviews]) { 29 | if ([self findSubviewInView:subview matching:test]) { 30 | return YES; 31 | } 32 | } 33 | return NO; 34 | } 35 | 36 | - (void)testRendersWelcomeScreen 37 | { 38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 40 | BOOL foundElement = NO; 41 | 42 | __block NSString *redboxError = nil; 43 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 44 | if (level >= RCTLogLevelError) { 45 | redboxError = message; 46 | } 47 | }); 48 | 49 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 50 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 51 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 52 | 53 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 54 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 55 | return YES; 56 | } 57 | return NO; 58 | }]; 59 | } 60 | 61 | RCTSetLogFunction(RCTDefaultLogFunction); 62 | 63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 64 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /streaming/frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest", 8 | "postinstall": "patch-package" 9 | }, 10 | "dependencies": { 11 | "react": "16.3.1", 12 | "react-native": "0.55.4", 13 | "react-native-camera": "^1.1.4", 14 | "react-native-fetch-blob": "^0.10.8", 15 | "react-native-file-utils": "^0.3.2", 16 | "react-native-fs": "^2.10.14", 17 | "react-native-tabs": "^1.0.9" 18 | }, 19 | "devDependencies": { 20 | "babel-jest": "23.0.1", 21 | "babel-preset-react-native": "4.0.0", 22 | "jest": "23.1.0", 23 | "patch-package": "^5.1.1", 24 | "react-test-renderer": "16.3.1" 25 | }, 26 | "jest": { 27 | "preset": "react-native" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /streaming/frontend/src/App.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | import React, { Component } from "react"; 3 | import { View, Text, StyleSheet, Dimensions } from "react-native"; 4 | import Tabs from "react-native-tabs"; 5 | import RecordVideo from "./RecordVideo"; 6 | import VideoOverview from "./VideoOverview"; 7 | const { height, width } = Dimensions.get("window"); 8 | 9 | export default class App extends Component { 10 | constructor() { 11 | super(); 12 | 13 | this.state = { 14 | page: "record" 15 | }; 16 | } 17 | render() { 18 | const { page } = this.state; 19 | return ( 20 | 21 | this.setState({ page: el.props.name })} 26 | > 27 | Watch 28 | Record 29 | 30 | 31 | {page === "record" && ( 32 | 33 | 34 | 35 | )} 36 | {page === "watch" && ( 37 | 38 | 39 | 40 | )} 41 | 42 | ); 43 | } 44 | } 45 | 46 | const styles = StyleSheet.create({ 47 | container: { 48 | flex: 1, 49 | justifyContent: "flex-start" 50 | }, 51 | contentContainer: { 52 | height: height - 75 53 | } 54 | }); 55 | -------------------------------------------------------------------------------- /streaming/frontend/src/Config.js: -------------------------------------------------------------------------------- 1 | const url = "192.168.178.47:3000"; 2 | 3 | export const ENDPOINT = `http://${url}`; 4 | export const WS_ENDPOINT = `ws://${url}`; 5 | -------------------------------------------------------------------------------- /streaming/frontend/src/RecordVideo.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | import React, { Component } from "react"; 3 | import { 4 | ActivityIndicator, 5 | StyleSheet, 6 | Text, 7 | TouchableOpacity, 8 | View 9 | } from "react-native"; 10 | import { RNCamera } from "react-native-camera"; 11 | import { WS_ENDPOINT } from "./Config"; 12 | import RNFetchBlob from "react-native-fetch-blob"; 13 | 14 | const FS_INTERVAL = 50; 15 | 16 | export default class RecordVideo extends Component { 17 | constructor() { 18 | super(); 19 | 20 | this.state = { 21 | recording: false, 22 | processing: false 23 | }; 24 | } 25 | render() { 26 | const { recording, processing } = this.state; 27 | 28 | let button = ( 29 | 33 | RECORD 34 | 35 | ); 36 | 37 | if (recording) { 38 | button = ( 39 | 43 | STOP 44 | 45 | ); 46 | } 47 | 48 | if (processing) { 49 | button = ( 50 | 51 | 52 | 53 | ); 54 | } 55 | 56 | return ( 57 | 58 | { 60 | this.camera = ref; 61 | }} 62 | style={styles.preview} 63 | type={RNCamera.Constants.Type.back} 64 | flashMode={RNCamera.Constants.FlashMode.on} 65 | permissionDialogTitle={"Permission to use camera"} 66 | permissionDialogMessage={ 67 | "We need your permission to use your camera phone" 68 | } 69 | onRecordingStarted={async ({ uri }) => { 70 | console.log("Recording started", uri); 71 | const data = await this.recordingStarted(uri); 72 | console.log("recording done", data); 73 | }} 74 | /> 75 | 78 | {button} 79 | 80 | 81 | ); 82 | } 83 | 84 | async recordingStarted(uri) { 85 | let data = ""; 86 | const ws = new WebSocket(WS_ENDPOINT); 87 | ws.onerror = e => { 88 | // an error occurred 89 | console.log("Websocket error", e); 90 | }; 91 | 92 | await new Promise((resolve, reject) => { 93 | ws.onopen = async () => { 94 | const stream = await RNFetchBlob.fs.readStream( 95 | uri, 96 | "base64" 97 | // undefined, 98 | // 1000 99 | ); 100 | stream.onEnd(() => { 101 | console.log("onEnd"); 102 | ws.close(); 103 | resolve(data); 104 | }); 105 | stream.onError(reject); 106 | 107 | stream.onData(chunk => { 108 | data += chunk; 109 | ws.send(chunk); 110 | }); 111 | 112 | stream.open(); 113 | }; 114 | }); 115 | } 116 | 117 | async startRecording() { 118 | this.setState({ recording: true }); 119 | // default to mp4 for android as codec is not set 120 | const { uri, codec = "mp4" } = await this.camera.recordAsync(); 121 | console.log("Record async finished"); 122 | 123 | // stop file watching & send the rest 124 | // this.setState({ recording: false, processing: true }); 125 | this.setState({ processing: false, recording: false }); 126 | } 127 | 128 | stopRecording() { 129 | console.log("STOP RECORDING IS CALLED"); 130 | this.camera.stopRecording(); 131 | } 132 | } 133 | 134 | const styles = StyleSheet.create({ 135 | container: { 136 | flex: 1, 137 | flexDirection: "column", 138 | backgroundColor: "black" 139 | }, 140 | preview: { 141 | flex: 1, 142 | justifyContent: "flex-end", 143 | alignItems: "center" 144 | }, 145 | capture: { 146 | flex: 0, 147 | backgroundColor: "#fff", 148 | borderRadius: 5, 149 | padding: 15, 150 | paddingHorizontal: 20, 151 | alignSelf: "center", 152 | margin: 20 153 | } 154 | }); 155 | -------------------------------------------------------------------------------- /streaming/frontend/src/VideoOverview.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | import React, { Component } from "react"; 3 | import { 4 | View, 5 | Text, 6 | StyleSheet, 7 | TouchableHighlight, 8 | Linking 9 | } from "react-native"; 10 | import { ENDPOINT } from "./Config"; 11 | 12 | export default class VideoOverview extends Component { 13 | constructor() { 14 | super(); 15 | this.state = { 16 | videos: [] 17 | }; 18 | } 19 | async componentWillMount() { 20 | try { 21 | const videos = await fetch(ENDPOINT).then(res => res.json()); 22 | this.setState({ 23 | videos: videos 24 | }); 25 | } catch (e) { 26 | console.error("error loading videos", e); 27 | } 28 | } 29 | 30 | openVideo(id) { 31 | const url = `${ENDPOINT}/${id}`; 32 | 33 | Linking.openURL(url).catch(err => 34 | console.error("An error occurred opening the link", err) 35 | ); 36 | } 37 | 38 | render() { 39 | const { videos } = this.state; 40 | 41 | return ( 42 | 43 | Videos 44 | {videos.map(({ id }) => ( 45 | 50 | Watch #{id} 51 | 52 | ))} 53 | 54 | ); 55 | } 56 | } 57 | 58 | const styles = StyleSheet.create({ 59 | container: { 60 | flex: 1, 61 | justifyContent: "flex-start" 62 | }, 63 | headline: { 64 | alignSelf: "center", 65 | fontSize: 18, 66 | marginTop: 10, 67 | marginBottom: 30 68 | }, 69 | videoTile: { 70 | alignSelf: "center", 71 | fontSize: 16, 72 | marginTop: 15 73 | } 74 | }); 75 | -------------------------------------------------------------------------------- /streaming/react-native-video-upload.postman_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "_postman_id": "57067d2d-df8a-4d32-9407-c5d56b8e331f", 4 | "name": "react-native-video-upload", 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" 6 | }, 7 | "item": [ 8 | { 9 | "name": "Get index", 10 | "request": { 11 | "method": "GET", 12 | "header": [], 13 | "body": {}, 14 | "url": { 15 | "raw": "" 16 | }, 17 | "description": "Should return hello world string" 18 | }, 19 | "response": [] 20 | }, 21 | { 22 | "name": "Get show", 23 | "request": { 24 | "method": "GET", 25 | "header": [], 26 | "body": {}, 27 | "url": { 28 | "raw": "" 29 | }, 30 | "description": "Get first image" 31 | }, 32 | "response": [] 33 | }, 34 | { 35 | "name": "Upload Video", 36 | "request": { 37 | "method": "GET", 38 | "header": [], 39 | "body": {}, 40 | "url": { 41 | "raw": "" 42 | } 43 | }, 44 | "response": [] 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /videos/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ -------------------------------------------------------------------------------- /videos/backend/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /videos/backend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | uploads 3 | 4 | -------------------------------------------------------------------------------- /videos/backend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:10 2 | 3 | ADD package*.json ./ 4 | RUN npm install 5 | 6 | ADD . . 7 | 8 | EXPOSE 3000 9 | ENTRYPOINT [ "npm", "start" ] -------------------------------------------------------------------------------- /videos/backend/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /videos/backend/index.js: -------------------------------------------------------------------------------- 1 | // The source for most of this backend is at https://scotch.io/tutorials/express-file-uploads-with-multer 2 | const express = require("express"); 3 | const multer = require("multer"); 4 | const cors = require("cors"); 5 | const Loki = require("lokijs"); 6 | const fs = require("fs"); 7 | const path = require("path"); 8 | 9 | const PORT = process.env.PORT || 3000; 10 | const DB_NAME = (process.env.DB_NAME || "db") + ".json"; 11 | const UPLOAD_PATH = process.env.UPLOAD_PATH || "uploads"; 12 | const COLUMN_NAME = process.env.COLUMN_NAME || "images"; 13 | 14 | const upload = multer({ dest: `${UPLOAD_PATH}/` }); 15 | const db = new Loki(`${UPLOAD_PATH}/${DB_NAME}`, { persistenceMethod: "fs" }); 16 | 17 | const app = express(); 18 | app.use(cors()); 19 | 20 | function loadCollection(colName, db) { 21 | return new Promise(resolve => { 22 | db.loadDatabase({}, () => { 23 | const _collection = 24 | db.getCollection(colName) || db.addCollection(colName); 25 | resolve(_collection); 26 | }); 27 | }); 28 | } 29 | 30 | app.post("/", upload.single("video"), async (req, res) => { 31 | console.log("POST /"); 32 | 33 | try { 34 | const col = await loadCollection(COLUMN_NAME, db); 35 | const data = col.insert(req.file); 36 | db.saveDatabase(); 37 | 38 | res 39 | .send({ 40 | id: data.$loki, 41 | fileName: data.filename, 42 | originalName: data.originalname 43 | }) 44 | .end(); 45 | } catch (err) { 46 | console.error(err); 47 | res.sendStatus(500).end(); 48 | } 49 | }); 50 | 51 | app.get("/", async (req, res) => { 52 | console.log("GET /"); 53 | const col = await loadCollection(COLUMN_NAME, db); 54 | 55 | res 56 | .json(col.data.map(entry => ({ id: entry["$loki"], path: entry.path }))) 57 | .end(); 58 | }); 59 | 60 | app.get("/:id", async (req, res) => { 61 | console.log("GET /", req.params.id); 62 | try { 63 | const col = await loadCollection(COLUMN_NAME, db); 64 | const result = col.get(req.params.id); 65 | 66 | if (!result) { 67 | res.sendStatus(404); 68 | return; 69 | } 70 | 71 | // Tutorial on streaming: https://medium.com/@daspinola/video-stream-with-node-js-and-html5-320b3191a6b6 72 | // Prepare sending the request 73 | const filePath = path.join(UPLOAD_PATH, result.filename); 74 | const headers = { 75 | "Content-Type": result.mimetype 76 | }; 77 | const stat = fs.statSync(filePath); 78 | const fileSize = stat.size; 79 | const range = req.headers.range; 80 | 81 | if (range) { 82 | const parts = range.replace(/bytes=/, "").split("-"); 83 | const start = parseInt(parts[0], 10); 84 | const end = parts[1] ? parseInt(parts[1], 10) : fileSize - 1; 85 | const chunksize = end - start + 1; 86 | const file = fs.createReadStream(filePath, { start, end }); 87 | 88 | res.writeHead(206, { 89 | ...headers, 90 | "Content-Range": `bytes ${start}-${end}/${fileSize}`, 91 | "Accept-Ranges": "bytes", 92 | "Content-Length": chunksize 93 | }); 94 | file.pipe(res); 95 | } else { 96 | const head = { 97 | "Content-Length": fileSize, 98 | "Content-Type": "video/mp4" 99 | }; 100 | res.writeHead(200, head); 101 | fs.createReadStream(filePath).pipe(res); 102 | } 103 | } catch (err) { 104 | console.log(err); 105 | res.sendStatus(400); 106 | } 107 | }); 108 | 109 | app.listen(PORT, () => { 110 | console.log("Server started on port", PORT); 111 | }); 112 | -------------------------------------------------------------------------------- /videos/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-video-upload-backend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "watch": "nodemon index.js", 8 | "start": "node index.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "cors": "^2.8.4", 14 | "express": "^4.16.3", 15 | "lokijs": "^1.5.5", 16 | "multer": "^1.3.0" 17 | }, 18 | "devDependencies": { 19 | "nodemon": "^1.17.5" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /videos/frontend/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /videos/frontend/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /videos/frontend/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | ; Ignore metro 20 | .*/node_modules/metro/.* 21 | 22 | [include] 23 | 24 | [libs] 25 | node_modules/react-native/Libraries/react-native/react-native-interface.js 26 | node_modules/react-native/flow/ 27 | node_modules/react-native/flow-github/ 28 | 29 | [options] 30 | emoji=true 31 | 32 | module.system=haste 33 | 34 | munge_underscores=true 35 | 36 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 37 | 38 | module.file_ext=.js 39 | module.file_ext=.jsx 40 | module.file_ext=.json 41 | module.file_ext=.native.js 42 | 43 | suppress_type=$FlowIssue 44 | suppress_type=$FlowFixMe 45 | suppress_type=$FlowFixMeProps 46 | suppress_type=$FlowFixMeState 47 | 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 49 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 50 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 51 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 52 | 53 | [version] 54 | ^0.67.0 55 | -------------------------------------------------------------------------------- /videos/frontend/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /videos/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | -------------------------------------------------------------------------------- /videos/frontend/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /videos/frontend/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.frontend", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.frontend", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | project.ext.react = [ 76 | entryFile: "index.js" 77 | ] 78 | 79 | apply from: "../../node_modules/react-native/react.gradle" 80 | 81 | /** 82 | * Set this to true to create two separate APKs instead of one: 83 | * - An APK that only works on ARM devices 84 | * - An APK that only works on x86 devices 85 | * The advantage is the size of the APK is reduced by about 4MB. 86 | * Upload all the APKs to the Play Store and people will download 87 | * the correct one based on the CPU architecture of their device. 88 | */ 89 | def enableSeparateBuildPerCPUArchitecture = false 90 | 91 | /** 92 | * Run Proguard to shrink the Java bytecode in release builds. 93 | */ 94 | def enableProguardInReleaseBuilds = false 95 | 96 | android { 97 | compileSdkVersion 27 98 | buildToolsVersion "27.0.0" 99 | 100 | defaultConfig { 101 | applicationId "com.frontend" 102 | minSdkVersion 16 103 | targetSdkVersion 22 104 | versionCode 1 105 | versionName "1.0" 106 | ndk { 107 | abiFilters "armeabi-v7a", "x86" 108 | } 109 | } 110 | splits { 111 | abi { 112 | reset() 113 | enable enableSeparateBuildPerCPUArchitecture 114 | universalApk false // If true, also generate a universal APK 115 | include "armeabi-v7a", "x86" 116 | } 117 | } 118 | buildTypes { 119 | release { 120 | minifyEnabled enableProguardInReleaseBuilds 121 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 122 | } 123 | } 124 | // applicationVariants are e.g. debug, release 125 | applicationVariants.all { variant -> 126 | variant.outputs.each { output -> 127 | // For each separate APK per architecture, set a unique version code as described here: 128 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 129 | def versionCodes = ["armeabi-v7a":1, "x86":2] 130 | def abi = output.getFilter(OutputFile.ABI) 131 | if (abi != null) { // null for the universal-debug, universal-release variants 132 | output.versionCodeOverride = 133 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 134 | } 135 | } 136 | } 137 | } 138 | 139 | dependencies { 140 | compile project(':react-native-camera') 141 | compile fileTree(dir: "libs", include: ["*.jar"]) 142 | compile "com.android.support:appcompat-v7:23.0.1" 143 | compile "com.facebook.react:react-native:+" // From node_modules 144 | } 145 | 146 | // Run this once to be able to run the application with BUCK 147 | // puts all compile dependencies into folder libs for BUCK to use 148 | task copyDownloadableDepsToLibs(type: Copy) { 149 | from configurations.compile 150 | into 'libs' 151 | } 152 | -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/java/com/frontend/MainActivity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/java/com/frontend/MainActivity.class -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/java/com/frontend/MainApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/java/com/frontend/MainApplication.class -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/bin/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | frontend 3 | 4 | -------------------------------------------------------------------------------- /videos/frontend/android/app/bin/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /videos/frontend/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | project.ext.react = [ 76 | entryFile: "index.js" 77 | ] 78 | 79 | apply from: "../../node_modules/react-native/react.gradle" 80 | 81 | /** 82 | * Set this to true to create two separate APKs instead of one: 83 | * - An APK that only works on ARM devices 84 | * - An APK that only works on x86 devices 85 | * The advantage is the size of the APK is reduced by about 4MB. 86 | * Upload all the APKs to the Play Store and people will download 87 | * the correct one based on the CPU architecture of their device. 88 | */ 89 | def enableSeparateBuildPerCPUArchitecture = false 90 | 91 | /** 92 | * Run Proguard to shrink the Java bytecode in release builds. 93 | */ 94 | def enableProguardInReleaseBuilds = false 95 | 96 | android { 97 | compileSdkVersion 27 98 | buildToolsVersion "27.0.0" 99 | 100 | defaultConfig { 101 | applicationId "com.frontend" 102 | minSdkVersion 16 103 | targetSdkVersion 22 104 | versionCode 1 105 | versionName "1.0" 106 | ndk { 107 | abiFilters "armeabi-v7a", "x86" 108 | } 109 | } 110 | splits { 111 | abi { 112 | reset() 113 | enable enableSeparateBuildPerCPUArchitecture 114 | universalApk false // If true, also generate a universal APK 115 | include "armeabi-v7a", "x86" 116 | } 117 | } 118 | buildTypes { 119 | release { 120 | minifyEnabled enableProguardInReleaseBuilds 121 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 122 | } 123 | } 124 | // applicationVariants are e.g. debug, release 125 | applicationVariants.all { variant -> 126 | variant.outputs.each { output -> 127 | // For each separate APK per architecture, set a unique version code as described here: 128 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 129 | def versionCodes = ["armeabi-v7a":1, "x86":2] 130 | def abi = output.getFilter(OutputFile.ABI) 131 | if (abi != null) { // null for the universal-debug, universal-release variants 132 | output.versionCodeOverride = 133 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 134 | } 135 | } 136 | } 137 | } 138 | 139 | dependencies { 140 | compile project(':react-native-camera') 141 | compile fileTree(dir: "libs", include: ["*.jar"]) 142 | compile "com.android.support:appcompat-v7:23.0.1" 143 | compile "com.facebook.react:react-native:+" // From node_modules 144 | compile group: 'commons-io', name: 'commons-io', version: '2.0.1' 145 | } 146 | 147 | // Run this once to be able to run the application with BUCK 148 | // puts all compile dependencies into folder libs for BUCK to use 149 | task copyDownloadableDepsToLibs(type: Copy) { 150 | from configurations.compile 151 | into 'libs' 152 | } 153 | -------------------------------------------------------------------------------- /videos/frontend/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/java/com/frontend/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.frontend; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "frontend"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/java/com/frontend/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.frontend; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import org.reactnative.camera.RNCameraPackage; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.shell.MainReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | return Arrays.asList( 26 | new MainReactPackage(), 27 | new RNCameraPackage() 28 | ); 29 | } 30 | 31 | @Override 32 | protected String getJSMainModuleName() { 33 | return "index"; 34 | } 35 | }; 36 | 37 | @Override 38 | public ReactNativeHost getReactNativeHost() { 39 | return mReactNativeHost; 40 | } 41 | 42 | @Override 43 | public void onCreate() { 44 | super.onCreate(); 45 | SoLoader.init(this, /* native exopackage */ false); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | frontend 3 | 4 | -------------------------------------------------------------------------------- /videos/frontend/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /videos/frontend/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | google() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.0.1' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | mavenLocal() 19 | jcenter() 20 | maven { 21 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 22 | url "$rootDir/../node_modules/react-native/android" 23 | } 24 | google() 25 | } 26 | } 27 | 28 | subprojects { 29 | project.configurations.all { 30 | resolutionStrategy.eachDependency { details -> 31 | if (details.requested.group == 'com.android.support' 32 | && !details.requested.name.contains('multidex') ) { 33 | details.useVersion "27.1.0" 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /videos/frontend/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /videos/frontend/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DanielMSchmidt/react-native-video-upload-demo/8c734f31484d1c63e5946220831be9a0ae34a51a/videos/frontend/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /videos/frontend/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 6 | -------------------------------------------------------------------------------- /videos/frontend/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /videos/frontend/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /videos/frontend/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /videos/frontend/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /videos/frontend/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'frontend' 2 | include ':react-native-camera' 3 | project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android') 4 | 5 | include ':app' 6 | -------------------------------------------------------------------------------- /videos/frontend/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "displayName": "frontend" 4 | } -------------------------------------------------------------------------------- /videos/frontend/index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from "react-native"; 2 | import App from "./src/App"; 3 | 4 | AppRegistry.registerComponent("frontend", () => App); 5 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontend-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontend-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontend.xcodeproj/xcshareddata/xcschemes/frontend-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontend.xcodeproj/xcshareddata/xcschemes/frontend.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontend/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | @interface AppDelegate : UIResponder 11 | 12 | @property (nonatomic, strong) UIWindow *window; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontend/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | NSURL *jsCodeLocation; 18 | 19 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 20 | 21 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 22 | moduleName:@"frontend" 23 | initialProperties:nil 24 | launchOptions:launchOptions]; 25 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 26 | 27 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 28 | UIViewController *rootViewController = [UIViewController new]; 29 | rootViewController.view = rootView; 30 | self.window.rootViewController = rootViewController; 31 | [self.window makeKeyAndVisible]; 32 | return YES; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontend/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontend/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /videos/frontend/ios/frontend/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontend/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | frontend 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | NSCameraUsageDescription 30 | Lets start a video 31 | 32 | 33 | NSPhotoLibraryUsageDescription 34 | Lets start a video 35 | 36 | 37 | NSMicrophoneUsageDescription 38 | Lets start a video 39 | UIRequiredDeviceCapabilities 40 | 41 | armv7 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | NSLocationWhenInUseUsageDescription 52 | 53 | NSAppTransportSecurity 54 | 55 | 56 | NSExceptionDomains 57 | 58 | localhost 59 | 60 | NSExceptionAllowsInsecureHTTPLoads 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontend/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontendTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /videos/frontend/ios/frontendTests/frontendTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | #import 12 | #import 13 | 14 | #define TIMEOUT_SECONDS 600 15 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 16 | 17 | @interface frontendTests : XCTestCase 18 | 19 | @end 20 | 21 | @implementation frontendTests 22 | 23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 24 | { 25 | if (test(view)) { 26 | return YES; 27 | } 28 | for (UIView *subview in [view subviews]) { 29 | if ([self findSubviewInView:subview matching:test]) { 30 | return YES; 31 | } 32 | } 33 | return NO; 34 | } 35 | 36 | - (void)testRendersWelcomeScreen 37 | { 38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 40 | BOOL foundElement = NO; 41 | 42 | __block NSString *redboxError = nil; 43 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 44 | if (level >= RCTLogLevelError) { 45 | redboxError = message; 46 | } 47 | }); 48 | 49 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 50 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 51 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 52 | 53 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 54 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 55 | return YES; 56 | } 57 | return NO; 58 | }]; 59 | } 60 | 61 | RCTSetLogFunction(RCTDefaultLogFunction); 62 | 63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 64 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /videos/frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "react": "16.3.1", 11 | "react-native": "0.55.4", 12 | "react-native-camera": "^1.1.4", 13 | "react-native-tabs": "^1.0.9" 14 | }, 15 | "devDependencies": { 16 | "babel-jest": "23.0.1", 17 | "babel-preset-react-native": "4.0.0", 18 | "jest": "23.1.0", 19 | "react-test-renderer": "16.3.1" 20 | }, 21 | "jest": { 22 | "preset": "react-native" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /videos/frontend/src/App.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | import React, { Component } from "react"; 3 | import { View, Text, StyleSheet, Dimensions } from "react-native"; 4 | import Tabs from "react-native-tabs"; 5 | import RecordVideo from "./RecordVideo"; 6 | import VideoOverview from "./VideoOverview"; 7 | const { height, width } = Dimensions.get("window"); 8 | 9 | export default class App extends Component { 10 | constructor() { 11 | super(); 12 | 13 | this.state = { 14 | page: "watch" 15 | }; 16 | } 17 | render() { 18 | const { page } = this.state; 19 | return ( 20 | 21 | this.setState({ page: el.props.name })} 26 | > 27 | Watch 28 | Record 29 | 30 | 31 | {page === "record" && ( 32 | 33 | 34 | 35 | )} 36 | {page === "watch" && ( 37 | 38 | 39 | 40 | )} 41 | 42 | ); 43 | } 44 | } 45 | 46 | const styles = StyleSheet.create({ 47 | container: { 48 | flex: 1, 49 | justifyContent: "flex-start" 50 | }, 51 | contentContainer: { 52 | height: height - 75 53 | } 54 | }); 55 | -------------------------------------------------------------------------------- /videos/frontend/src/Config.js: -------------------------------------------------------------------------------- 1 | export const ENDPOINT = "http://192.168.178.47:3000"; 2 | -------------------------------------------------------------------------------- /videos/frontend/src/RecordVideo.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | import React, { Component } from "react"; 3 | import { 4 | ActivityIndicator, 5 | StyleSheet, 6 | Text, 7 | TouchableOpacity, 8 | View 9 | } from "react-native"; 10 | import { RNCamera } from "react-native-camera"; 11 | import { ENDPOINT } from "./Config"; 12 | 13 | export default class RecordVideo extends Component { 14 | constructor() { 15 | super(); 16 | 17 | this.state = { 18 | recording: false, 19 | processing: false 20 | }; 21 | } 22 | render() { 23 | const { recording, processing } = this.state; 24 | 25 | let button = ( 26 | 30 | RECORD 31 | 32 | ); 33 | 34 | if (recording) { 35 | button = ( 36 | 40 | STOP 41 | 42 | ); 43 | } 44 | 45 | if (processing) { 46 | button = ( 47 | 48 | 49 | 50 | ); 51 | } 52 | 53 | return ( 54 | 55 | { 57 | this.camera = ref; 58 | }} 59 | style={styles.preview} 60 | type={RNCamera.Constants.Type.back} 61 | flashMode={RNCamera.Constants.FlashMode.on} 62 | permissionDialogTitle={"Permission to use camera"} 63 | permissionDialogMessage={ 64 | "We need your permission to use your camera phone" 65 | } 66 | /> 67 | 70 | {button} 71 | 72 | 73 | ); 74 | } 75 | 76 | async startRecording() { 77 | this.setState({ recording: true }); 78 | // default to mp4 for android as codec is not set 79 | const { uri, codec = "mp4" } = await this.camera.recordAsync(); 80 | this.setState({ recording: false, processing: true }); 81 | const type = `video/${codec}`; 82 | 83 | const data = new FormData(); 84 | data.append("video", { 85 | name: "mobile-video-upload", 86 | type, 87 | uri 88 | }); 89 | 90 | try { 91 | const res = await fetch(ENDPOINT, { 92 | method: "post", 93 | body: data 94 | }); 95 | } catch (e) { 96 | console.error(e); 97 | } 98 | 99 | this.setState({ processing: false }); 100 | } 101 | 102 | stopRecording() { 103 | this.camera.stopRecording(); 104 | } 105 | } 106 | 107 | const styles = StyleSheet.create({ 108 | container: { 109 | flex: 1, 110 | flexDirection: "column", 111 | backgroundColor: "black" 112 | }, 113 | preview: { 114 | flex: 1, 115 | justifyContent: "flex-end", 116 | alignItems: "center" 117 | }, 118 | capture: { 119 | flex: 0, 120 | backgroundColor: "#fff", 121 | borderRadius: 5, 122 | padding: 15, 123 | paddingHorizontal: 20, 124 | alignSelf: "center", 125 | margin: 20 126 | } 127 | }); 128 | -------------------------------------------------------------------------------- /videos/frontend/src/VideoOverview.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | import React, { Component } from "react"; 3 | import { 4 | View, 5 | Text, 6 | StyleSheet, 7 | TouchableHighlight, 8 | Linking 9 | } from "react-native"; 10 | import { ENDPOINT } from "./Config"; 11 | 12 | export default class VideoOverview extends Component { 13 | constructor() { 14 | super(); 15 | this.state = { 16 | videos: [] 17 | }; 18 | } 19 | async componentWillMount() { 20 | try { 21 | const videos = await fetch(ENDPOINT).then(res => res.json()); 22 | this.setState({ 23 | videos: videos 24 | }); 25 | } catch (e) { 26 | console.error("error loading videos", e); 27 | } 28 | } 29 | 30 | openVideo(id) { 31 | const url = `${ENDPOINT}/${id}`; 32 | 33 | Linking.openURL(url).catch(err => 34 | console.error("An error occurred opening the link", err) 35 | ); 36 | } 37 | 38 | render() { 39 | const { videos } = this.state; 40 | 41 | return ( 42 | 43 | Videos 44 | {videos.map(({ id }) => ( 45 | 50 | Watch #{id} 51 | 52 | ))} 53 | 54 | ); 55 | } 56 | } 57 | 58 | const styles = StyleSheet.create({ 59 | container: { 60 | flex: 1, 61 | justifyContent: "flex-start" 62 | }, 63 | headline: { 64 | alignSelf: "center", 65 | fontSize: 18, 66 | marginTop: 10, 67 | marginBottom: 30 68 | }, 69 | videoTile: { 70 | alignSelf: "center", 71 | fontSize: 16, 72 | marginTop: 15 73 | } 74 | }); 75 | -------------------------------------------------------------------------------- /videos/react-native-video-upload.postman_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "_postman_id": "57067d2d-df8a-4d32-9407-c5d56b8e331f", 4 | "name": "react-native-video-upload", 5 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" 6 | }, 7 | "item": [ 8 | { 9 | "name": "Get index", 10 | "request": { 11 | "method": "GET", 12 | "header": [], 13 | "body": {}, 14 | "url": { 15 | "raw": "" 16 | }, 17 | "description": "Should return hello world string" 18 | }, 19 | "response": [] 20 | }, 21 | { 22 | "name": "Get show", 23 | "request": { 24 | "method": "GET", 25 | "header": [], 26 | "body": {}, 27 | "url": { 28 | "raw": "" 29 | }, 30 | "description": "Get first image" 31 | }, 32 | "response": [] 33 | }, 34 | { 35 | "name": "Upload Video", 36 | "request": { 37 | "method": "GET", 38 | "header": [], 39 | "body": {}, 40 | "url": { 41 | "raw": "" 42 | } 43 | }, 44 | "response": [] 45 | } 46 | ] 47 | } --------------------------------------------------------------------------------