Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Download / Stream video files in AGK - a smoother approach?

Author
Message
Dybing
12
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 29th Jan 2018 12:51 Edited at: 29th Jan 2018 12:56
The app I am working on is very video-intensive. Short description, a game to train understanding of sign-language by matching a given sign (video) to one of three symbols (images) - see screenshot below:



Anyhow how it works now is that on the client there is a JSON containing all the words and names of associated files. This and the symbol-images are synced from server at start of application. I got a rather nice solution for this if I must say so myself - that automatically updates the client if and when there are any changes or additions to the wordslist or any of the images.

However, storing all those videos on the client is a bit ambitious - we have well over 1000 professional made signs (more to come), and our users got thousands more signs made. So the videos are stored on our file-repo online - though in time it'll be possible to download and store locally on the client the users own made signs.

However, as it is now the client request a video through a simple fileserver functionality of my API server - the server picks it from the file repo and then the client need save the received file (using GetHTTPFile()) on the client - simply named the downloaded file 'target.mp4' before then loading it (using LoadVideo()) and use it. This seems a bit inefficient. Is there a way to instead stream video into memory, keep it there and play it back from there once fully downloaded - ideally bypassing the filesystem entirly?! Something tells me memblocks could be used for this - but I've not really used that feature of AppGameKit yet.

Performance today isn't too bad - though that is mostly due to the miniscule size of the videos - about 200kb each. So saving and then loading is pretty snappy. Though there are some timing issues on older devices. They try and load the file before it is entirely saved - I am sure this is OS related (Android version 4.X is where I've experienced this, not on 5.X or later). But keeping it all in memory would be even snappier - fix the timing issue - and also would reduce eMMC/SD-Card wear and tear. Plus would leave no residual trace on the device. As of now, the last downloaded video will always be present, as I do not delete the resulting 'target.mp4' file, just overwrite it for each download.

Login to post a reply

Server time is: 2024-04-27 01:08:21
Your offset time is: 2024-04-27 01:08:21