How to play video using Intent in Android?
First, the video may have issues, as not all videos are safe for streaming.
Second, not all devices may have activities set up to support ACTION_VIEW
on video/mp4
files that are streamed. You should use PackageManager
and queryIntentActivities()
to confirm whether the startActivity()
call will find a match, or handle the ActivityNotFoundException
that you get.
Android - Intent to play a video externally at a given time position
I want to specify the time position where to start the video
ACTION_VIEW
does not offer any extras related to this. Few video player apps will support this, as a result.
2) Maybe more difficult, but I want to retrieve the position of the video when you user stop watching it and returns to my app.
ACTION_VIEW
does not offer anything related to this either.
You need to implement video playback within your app itself, using:
VideoView
MediaPlayer
and aSurfaceView
- ExoPlayer
- LibVLC
- etc.
Alternatively, you could force the user to install a particular video player that does offer your desired feature set, such as VLC.
How to play video mp4 using intent from my android app? This is possible?
Somebody had this issue before. Check these links and see if they give you a good starting point to solve the problem:
Android intent for playing video?
How to play a video (.mp4) from assets or raw folder with the video intent?
Related Topics
When Should One Use Theme.Appcompat VS Themeoverlay.Appcompat
How to Display a List of Images in a Listview in Android
Navigationview and Custom Layout
How to Display Image in Android's Textview
Android:Configchanges="Orientation" Does Not Work with Fragments
Overlap Scrolling View with Appbarlayout
Implementing a Rich Text Editor in Android
Gatt Callback Fails to Register
Switching to Landscape Mode in Android Emulator
How to Hide a Button Programmatically
How to Display Progress While Loading a Url to Webview in Android
How to Style the Standard React-Native Android Picker
Android - Acceleration Down (Smash)
How to Set Up Dagger Dependency Injection from Scratch in Android Project