How to simultaneously play/stream a video and save it? - android

I'm working on an iOS and Android app that allows the user to stream/play videos.
I would like to create an offline mode that gives the user the ability to play an already-saved video. To do so, I would like the app to save locally the currently played video if the user has a WiFi connection.
To do that, I would need a mechanism to read and save at the same time a video.
Any ideas to do that on iOS or/and Android?

read and save at the same time
I guess you would have to span two different threads : one to read, and another to save.
And have the 'read' method try to get data from cache before downloading it.
on iPhone, possible duplicates :
Play video from cache in iphone programatically
Simultaneously stream and save a video?
The method described in these answers - caching download on disk, and read video from that file - should be the same for Android.

Related

Encrypt large files on flutter and access them only through in-app

I am developing a digital media app using Google's flutter framework which contains songs, movies and etc. The main focus is, these media content should be accessible only through the app and not by outside methods (eg: media players, file browsers).
Eg: A music file which was downloaded through the app should only be played within the app and not by any media player. In that case, there should be an encryption method which should be used to lock these files from outside world.
In this case, bigger files such as Movies should also be taken into consideration. The size of a file can be anywhere between few kbs to 2-3 GBs.
What should be the better approach when solving this problem?
Is it to
Store everything in a database after encrypting the bytes?
Encrypt the entire file and still keep them in the form of "file"?
The downloaded data should also be able to be consumed quickly once the user requested for it. And once the consume is done, the file should be locked again from the rest of the world.
I am not sure if this topic is too broad but somehow I would appreciate it if anyone could provide me with something to start off.
Thank you.

video can not be accessed outside the application

I am developing an application where downloaded video can not be accessed by user outside the app. I want to know how to make it possible that user can not accessed video outside the app and only play it in the app. thanks.
Yes it's possible to do so infact popular apps like youtube do it when you download a video for offline loading. you have to encrypt the video and delete the original. After doing that decode it back when you want to play

Play a streaming url without save temporary files on device

i've created an Android application that connects to a streaming page. I'd like to know if some data will be stored on my device (like on a temporary folder or similar). This video should be only accessed by the URL so i'd like to prevent any download.
Is there a way to prevent the 'download' of the streaming data on my device? Or if it must be downloaded, can i be sure that no one can use this data if found in a temp file?
Thanks
EDIT
For the web page, i've used this code: http://codesamplez.com/programming/php-html5-video-streaming-tutorial
There is a better way? I was thinking about create an HTML5 video player and use it in my android application as a web view. As i said before, the important thing is to deny any download.

How can i allow users to save videos which are streamed in webview

I have an app which is using android webview .i am able to stream video in webview .i want know how can i allow users to to save videos automatically in thier internal storage which they stream in webview on website ? Thanks in advance
Most videos streaming to a browser (PC or mobile) will not allow download as the owner of the video may not want to allow it be saved and copied etc.
Simple http progressive download may allow you to save the video in a regular browser by simply right clicking on it.
DRM protected video will generally use a video pipeline (a sort of 'path' through your device) that does not allow an application of any kind access the raw video - this is again is to avoid people making unauthorised copies.
If you think the video in your case is allowed to be copied then you may find it easier to write some functionality to act as the streaming client and save the file locally. You could also pass the received stream along to the media player or to a webview if you wanted to play the file in parallel to saving it.

Securing Video in android

Im presently working on an android application which will allow the user to download video and audio content from a server and play them on the phone of the end user.
What I'm trying to do is to secure the audio and video. The files should not be accessible to other applications and the user must not be able to take them off the device and use them.
This is a shot in the dark but can i do this by storing the videos in theSQLLite database as blobs.
And also is it possible to play the videos in android if they are stored as blobs.
I wouldn't use blobs, they are only performant if the binary-files are 256KB or less.
I guess the only way to make the videos secure so the user can't use them is to stream them down from you'r server and deleting the buffer when the Application closes.
On a rootet Device, you have access to every directory, so you can't save the videos on the SDcard or the Phone-Memory.

Categories

Resources