I want to prefetch/predownload some data of video which is stored on my server.
Right now I streaming the video from the server, It requires some time to buffer then it will start playing video. So I want to prefetch some data of video so that when user clicks on it video get play without taking too much time.
How to achieve this can I store it in database some data or download file while set list of videos in listview.
Please help with this problem.I didn't understand what to do?
I have used Exoplayer which as this feature and many more. Demo repositorie also available.
Related
I have been searching a lot about this by now and I got nothing:
I am trying to play a video from firebase storage and trying to be able to see its progress on the player as it loads and to be able to seek it backward and forward (stuff that any player does while streaming a video).
The problem:
Firebase team say that it is not possible to stream a video from the cloud storage (it is not supported).
Eventhough I was able to do this:
String url = "my_url_at_firebase_storage";
video_View.setVideoUri(Uri.parse(url));
video_View.start();
and I was able to load the video from firebase storage into a video view.
I checked:
I checked this link that has an answer that says you have to transcode the video to chunks and save the chuncks to firebase storage and then load them:
But I am lost here:
1) What are chunks of video?
2) How would you stream these chunks if firebase doesn't support streaming?
My question:
As this topic is rarely documented and the link above doesn't provide enough info about how to acheive it:
I ask:
If firebase doesnt support streaming how come we are able to load video directly to videoview?
Tried the same with exoplayer and didn't work?
Thanks for your efforts.
"Transcoding the video into chunks" means dividing it into multiple small pieces (separate files). Those parts are then uploaded to Firebase Cloud Storage.
Once you divided the video into those pieces, you can download them. Since Firebase does not support streaming, you have to download each chunk entirely before playing, but the trick is that you only have to download that chunk, not the entire video.
Does that answer your question?
I have video uploaded on server. which is trailer of movie. I can play this video direct to my videoView with the help of live url. My question: is there any method in android which help me out to get a video frame from url without download the video to local storage. I know one method name "createvideothumbnail" but it will not work in my case. because i need to get the video thumbnail without download the whole video. as you have seen the mechanism is implemented in imdb official app (Trailer section).
Please help, thanks in advance
Getting thumbnails without download the complete video is not possible until now (API Level 22) i´m pretty sure that the application that you describe load thumbnails that were created previously.
the current option would be using the class:
import android.provider.MediaStore.Video.Thumbnails;
or create the thumbnails in a separated process.
The requirement is to list a Videos thumbnails and on clicking it should play related video into Application. i am able to play url where video is located using Video View. But now i want to implement this thing in a better ways like Watsapp and instagram. If anybody have a good experience in this reference please share with me. I want to play around caching video and playing videos from cache without buffering (Video view is showing buffering bar and very slow in performance user have to wait a lot for starting a Video). Any kind of help will be appreciated. thanks.
I did it own my own. It's very simple to implement What i do is to download the video with async task along with a progressing seek bar. Once it's downloaded i'll save it in a Folder in my sdcard. We should create a Folder named as Application name so easy to identify and also always available videos with out opening application as well and next time however when i want to watch video again in my application it just check weather it is available in sdcard if yes then play immediately if not then download it. I am happy.
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.
I have an app that download a video from ftp then save on sd card in encrypted form , when user want to see that videos , then it decrpted and then showing but i have a problem with that is takes long dely on decrption. Is there any way to play a video like live streaming when it is in decrption process.
To implement your streaming scheme, you need two main components: a streaming server such as a local http instance and a javax.crypto.CipherInputStream. LocalSingleHttpServer is an example of that kind of implementation.