I’m writing an app where the user can select a video from gallery and then play it later. I’m using the ACTION_GET_CONTENT intent to allow the user to select the video.
Intent intent = new Intent();
intent.setType("video/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Video"), REQUEST_TAKE_GALLERY_VIDEO);
When a local file is selected there is no problem. The Uri is obtained immediately and can be launched using the default player without any delay.
The problem I’m trying to solve is when a non-locally stored video is selected a message saying “Preparing your selected media” pops up and there is a wait while the video is downloaded. Depending on the size of the video the wait can be very long and if the video is very large I’ll get a message saying it couldn’t get the file.
What I would like to happen is exactly what would happen if the video was selected outside of my app. If I want to watch the video in the default google player, it pops right up and plays without any delay.
I don’t need to download the file, I just want to launch it for streaming using the default app.
Is this possible?