justaniceguy
New Member
What I want to do
I want to create an app that only has a webview and a camera view and does the following:- The user will only use on website in a webview and think this is the app.
- When the user visits some specific URL pattern (
http://localhost:8000/post/<post_id>/upload-video?post_type=<post_type>
) it should open the camera and temporarily store thepost_id
andpost_type
.
Example: In this case of the URLhttp://localhost:8000/post/1125/upload-video?post_type=co
it should open the camera and store the "1125" as thepost_id
and "co" as thepost_type
. - Then, when the user records a video, I want him to be able to see the video and decide if they want to save it or re-record it.
- When they save it, they should save it to a website via API. This is an example of how it would be saved using CURL:
Bash:
curl -X POST http://localhost:8000/api/post/ \
-F "post=1125" \
-F "media_file=@/path/to/file.mp4" \
-F "post_type=co" \
-F "post_sub_type=" \
-H "Content-Type: multipart/form-data"
5. Finally, They should be redirected to the webview, to some specific URL, for example,
http://localhost:8000/post/<post_id>
.What I know and what I don't
- Step 1: I know how to create the webview. But I don't know how to use the camera.
- Step 2: I know how to keep an eye on the visited URL, but I don't know how to test the URL pattern. Neither do I know how to open the camera.
- Step 3: I guess I can find a way to do it by myself.
- Step 4: I know there is a way to work with APIs but I don't know how or how to send a recorded video. This is the main reason why I came here.
- Step 5: I can figure it out. Probably I just need to update the browser URL in the same block that saves the video.
In summary, what do I need
I would appreciate any help on:- Testing the URL patterns. Does B4A support regex? How can I do it?
- Recording videos. I couldn't find any tutorial on that.
- Posting the recording video via the API. I had no Idea.