user1487835
user1487835

Reputation: 33

Play video with direct link on Android

I need to play a video with fullscreen when a user plays it. Unfortunately, as far as I understand, if the HTML5 Video tag is used, Android plays it in-frame. So that tried webkitEnterFullScreen() and it seems to work(kind of...) but user has to click the play button again. Overall performance feels a bit clumsy and not sure if old OS like 2.0+ could handle it.

As an alternative method, I'm now trying to play video using direct link rather than the Video tag. For example, [a href="video.mp4"]Click to play[/a]. I think that it works well but the only problem is that it asks to choose a application either 'Video Player' or 'Browser'.

So my question is

  1. How can I define using javascript to play the video using Video Player, so that the selection dialog won't prompt?.
  2. What is the native video player for Android? For example, iOS uses Quicktime and it is possible to embed video using Quicktime object. And are there any equivalent method for Android?
  3. When the Video tag is used, how to play video simultaneously with fullscreen?

Upvotes: 1

Views: 1130

Answers (2)

Sathishkumar
Sathishkumar

Reputation: 3414

try following code :

String path1="/path/to/video/file.3gp";
Uri uri=Uri.parse(path1);
VideoView video=(VideoView)findViewById(R.id.VideoView01);
video.setVideoURI(uri);
video.start();

Upvotes: 1

EsbenG
EsbenG

Reputation: 28162

You have to realize something very important: There is no native video player for android.

There is a dozens players for android and it is not your decision but the users decision if he should use player A or B. Don't try to force Android users to iOS behavior, it really doesn't give a better impression.

Upvotes: 0

Related Questions