How to make videos download and play inside unity app? - android

Hello so I am trying to make online videos download on the android export app from unity and then play it back in the same app. so far I have used a plugin EasyMovieTexure asset for streaming online videos but cannot find a way to download videos and play them. I have searched and found that I can download the video with Android Application.persistentDataPath but I don't know how to use it and save the video file to a location on android.
Help is much appreciated.

the easiest way will be using System.IO.File.WriteAllBytes () to save all byte data from the WWW object. But this method actually need RAM to hold the whole file for a while. It doesn't work if the file is too big. if the file size is too big, you probably need another way to do the downloading and saving

Related

Where should I put mp4 file during development?

I'm not good at English, so I'm sorry if there are any mistakes in the expression.
I want to Object detection application on Android.
Here is how the app works:
Take some videos for which you want to perform object detection
Select a video from the taken videos
Detect specify object and get that coodinates
To develop avobe app,I have some videos for vertification.
Here is my question. Which folder should I put the vertification videos?
For now, I put the videos in raw folder.
But,I am creating an app assuming that the videos were taken with a camera. If so, should it be in the same place as if it were taken by the camera? and, which folder should the videos be placed in?
I'm new to android development.
Could anyone give me some advice? Thank you.
As you are new to Android development I am going to explain in detail.
First you have the videos for verification. You should put those videos in raw folder. But what if the size of those videos is too large? That means the size of your APK will also increase which is not a good thing if you want to upload your app on google play store. In this case, you can store those videos on your own server, and when user installs your app download those videos from the server.
Now let's come to the second question: Where should I put the videos taken with the camera?
You can put these videos in any of the following paths.
context.getFilesDir();
or
context.getExternalFilesDir(null);
These paths are on which you can store the camera-shooted videos and do any processing on them. If you want to know the difference between these two paths that's another topic. You can learn about them here.

How to implement audio streaming app and secure storage in flutter

I am about to build an app like deezer using flutter https://play.google.com/store/apps/details?id=deezer.android.app now for I have 2 question.
Is there any library for online audio streaming which may give the possibility to download the app
How can I store my audio files in a private / hidden folder such as folder created using vault app in case of download https://play.google.com/store/apps/details?id=com.netqin.ps
Thanks for your help
To stream audio you can use this library:
AudioPlayers
To keep your files safe you can use the Sandbox folder in iOS and getExternalFilesDir in Android.
You can find an example of how to implement the saving of the file over here:
Saving data to Local Storage in Flutter
I remind you that SOF is to show what you've done so far, some of your progress, examples, etc so we can help you with that and not how to build an entire app.

Best way to bundle ~55MB of audio with app

I have an app I am developing that needs to include about 55MB of audio (mp3s) these are short files and about 1000 in total. Bundling these in the apps assets makes the compiled apkabout 60MB.
I want to upload this app to the play store but of cause its to big as it it.
So my questions is, before I start working on using the APK Expansion File system is there anyway I could compress the audio files so the apk fits in under the 50MB limit?
The audios current bit rate is 128kbps
I guess Its better if you can make a player for stream the audio from the internet just like youtube does for their android application to play video files on android phone.
Additionally you can give option to the user to select save the audio for next time play without internet download.
I think this is a good question and +1 from me

Phonegap Android App - Display Store MP3 Media

I've been following this blog to help me make a simple music player function with an Android app (http://simonmacdonald.blogspot.com/2011/05/using-media-class-in-phonegap.html).
All works well - but I would like some way to extract a list of all music media stored on the phone so the user can click a file and play it. Does anyone know if this is possible via phone gap? I'd need to access track name/artist etc and a link to the track.
Cheers
Paul
Prognosis is not good.... PhoneGap does not have an API for accessing the media library. So, you would have to fall back to the File API to locate music files, and then... you would have to read the binary data in the actual files to extract out the track/artist metadata. Ouch. Seems pretty impractical.
[EDIT]
By the way, PhoneGap is not the only game in town. Appcelerator seems to solve the same problem, and apparently has a richer API, which includes
access to media metadata

android secure data storage

i am developing one android application. it download videos from server and store it in mobile.
i want to store those video in secure manner.(deny the user from copying. or deny them from viewing the video directly from sdcard)
i found two ways to solve the problem.
1)Store the video's inside the application.
2)Encrypt the entire video
but facing some problem in implementing solution
i)first solution found suitable. but i am fearing that. if we store too much video inside the application .it would become bulkier.and fore the user to uninstall.
ii)but in second solution. i did not find any correct way to do so.
so please help me to solve the problem.
This is kind of suggestion :
To store the videos you must have created some folder on SDCARD, so you can hide the folder by putting the "." in front of the name while creating it. on top of this you can encrypt the video file using AES algorithm so it can not be viewed, if copied outside the android it will not be view able. but from your application you can decry-pt the file and view it.
Definitively, you must encrypt the media and that's quite simple. What is more difficult is to play the media, because MediaPlayer only accepts clear contents. A basic way would be to convert an encrypted file to a decrypted one, just for the time of the playing session. A better approach is to build a stream from the file, decrypt that stream and feed it to the player. The hard point is to have a local http server to serve the stream.

Categories

Resources