So, by having a web view implementation, you officially have opened a can of bees for potential DDoS abuse and other types of abuse such as users having their cameras on all the time on their desktops 24/7 and just running up a huge bill on your AWS account.
How about this for a money saving tip:
I know it sounds super crazy and impossible to fathom, but why don’t you make it so that the webview accesses the cameras directly VIA Wifi if watched from a machine on the same network!
I mean how hard could it be to simply modify the firmware to have a few bytes of memory available to store a couple of IP addresses that could be retrieved from the Wyze API response that lists any connected network addresses that have been authorized to also receive the camera picture data.
Then, using the very same implementation that is used on the wyze servers to receive the picture and convert it to a viewable video, you instead port just the necessary code to decode/encode the video into the web browser and connect to the camera directly using websockets!
Whats that ? Web sockets too complex? Why not just implement a server-side websocket receiving API that works on the same exact implementation, thereby making sending the packets as simple as:
for each (ip in send_list) {
send_camera_packet(ip, camera_video)
}
This way you can REMOVE the REMOTE packet sending when nobody is watching or NOTHING IS HAPPENING, or ADD A LOCAL NETWORK IP ADDRESS OBTAINED FROM THE Wyze API if somebody wants to stream 24/7 but still watch remotely sometimes!!
Whats that? Your chips don’t have enough memory to add a for loop??
Why don’t you add another 1 megabyte of memory to those cameras for an extra $4.99? Then you could do this:
Save the entire frame onto the camera memory, save the next frame in the memory, compare the pixels and if enough pixels are different in color value from the previous frame, send it remotely, otherwise discard the old frame, and repeat. This process takes around 3ms to do if you only do low-res comparisons and will save your company hundreds or even thousands yen or dollars or whatever for years to come.
If you don’t do the steps listed, you will find that you will not be able to meet the demands of users in terms of bandwidth due to you having a non-scalable API
Keep everything local except for what NEEDS to go remote… NEVER send ANYTHING remote that can be sent over a LOCAL NETWORK!!!
!!!