Android Intent for Playing Video

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 a SurfaceView
  • 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



Leave a reply



Submit