Created
June 19, 2019 10:28
-
-
Save drexel-ue/e27199cc060b61146830ba89b1754512 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void _uploadVideo(UserData userData) async { | |
| String selectedFilter = _filterTitleSubject.value ?? 'Normal'; | |
| final url = 'http://10.0.2.2:8888/videos'; | |
| final body = { | |
| 'video': base64Encode(await videoFile.readAsBytes()), | |
| 'userID': userData.id, | |
| 'createdBy': userData.displayName, | |
| 'appliedFilter': selectedFilter, | |
| 'title': title, | |
| 'aspectRatio': cameraController.value.aspectRatio, | |
| 'content': content, | |
| 'public': public, | |
| 'latitude': latitude, | |
| 'longitude': longitude, | |
| 'type': type, | |
| 'duration': videoPlayerController.value.duration.inMilliseconds, | |
| 'startTime': startTime, | |
| }; | |
| // final headers = {"Authorization": "Bearer ${userData.token}"}; | |
| final response = await http.post( | |
| url, | |
| body: body, | |
| // headers: headers, | |
| ); | |
| if (response.statusCode == 200) { | |
| print("UPLOADED!"); | |
| } else { | |
| print('>>>RESPONSE ${response.reasonPhrase}'); | |
| } | |
| _clear(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment