How to play video(.mp4 file) on adroid and ios

  • 1
  • Problem
  • Updated 6 years ago
Hi Team,

I want to play video(.mp4 file) in my project, So for that i used HTML5 video tag, but it doesn't play video.
I am implementing project for ios and android.
I tried many ways, i didn't clear this problem.

Please tell me solution for my problem.

Thank you,
Prasad.
Photo of gudluri siva

gudluri siva

  • 62 Posts
  • 0 Reply Likes

Posted 8 years ago

  • 1
Photo of gudluri siva

gudluri siva

  • 62 Posts
  • 0 Reply Likes
Hi Team,

Still I didn't get any solution from support team, please give solution for as soon as possible.

thank you,
Prasad.
Photo of Yi Ming Kuan

Yi Ming Kuan

  • 1840 Posts
  • 78 Reply Likes
Hi Prasad,

For Android, HTML5 video tags only work on PhoneGap 2.2.0 or higher, and currently does not support videos embedded in the assets folder. You will have to use the video player plugin for that instead.

The video tags should work fine on iOS.

-yiming
Photo of Paridhi Sethi

Paridhi Sethi

  • 1 Post
  • 0 Reply Likes
what is this video player plugin?
Photo of Nikhil

Nikhil

  • 21 Posts
  • 0 Reply Likes
Pls check in the repository
https://github.com/phonegap/phonegap-...
Photo of gudluri siva

gudluri siva

  • 62 Posts
  • 0 Reply Likes
Hi Yi Ming Kuan,

Thank you for kind response,

I am struggling about Facebook and twitter integration with phone gap application,
I tried few ways after posting wall on face book its redirect to Facebook URL, but I want to return back to our application page. Twitter also doing same thing.

Could you give any solution or alternative ways for this problem.

Thank you,
Prasad.
Photo of Kunal Sharma

Kunal Sharma

  • 1 Post
  • 0 Reply Likes
please provide me video player plugin using phonegap i am totaly disappointment from phonegap

sharmakunal312@gmail.com

please help me and provide me on this gmail account
Photo of gudluri siva

gudluri siva

  • 62 Posts
  • 0 Reply Likes
Sharma,

No need to use any plugin use direct html5 video tag.

Thanks,
Prasad.
Photo of Nikhil

Nikhil

  • 21 Posts
  • 0 Reply Likes
Hi Siva,

Can you help me with a sample for the video to get it working, as I am unable to do so.

I know its a small thing, but have tried a lot of options but all in vain.

Regards,
Nikhil Juneja
Photo of neil briscombe

neil briscombe

  • 1 Post
  • 0 Reply Likes
Hi,

I am using phonegap build with html both audio and video tags. The resulting blackberry app plays video fine but andriod doesn't when deployed on to a 4.0.4 platform (galaxy s2).

Is this because of a problem similar to the asset folder issue mentioned above?

Kind regards,

Neil.
Photo of Nikhil Juneja

Nikhil Juneja

  • 2 Posts
  • 0 Reply Likes
hi Neil,

Android is a problem child in this case. you will have to make use of video plugin.
Photo of Nikhil Juneja

Nikhil Juneja

  • 2 Posts
  • 0 Reply Likes
hi Neil,

Android is a problem child in this case. you will have to make use of video plugin.
Photo of mirkolofio

mirkolofio

  • 2 Posts
  • 0 Reply Likes
Please provide a sample. It would be useful to everyone.
Photo of ismael jimoh

ismael jimoh

  • 4116 Posts
  • 192 Reply Likes
Hi Mirkolofio,

Use normal video tag for iOS.

For Android, you can add this plugin and follow the sample shown here(commented usage section shows how to use the plugin) for utilizing it.

You can use device.platform to check which platform your are on and play video accordingly:

if(device.platform =="iOS"){
   [video][/video]
}
else if(device.platform =="android"){
    VideoPlayer.play("file:///path/to/my/video.mp4");
}

Thanks.
Photo of mirkolofio

mirkolofio

  • 2 Posts
  • 0 Reply Likes
No way to get a sample working version just to download and run?

Btw, min. Android version?

Thanks,
Photo of Rashad Glover

Rashad Glover

  • 3 Posts
  • 0 Reply Likes
Can anybody give a straight answer or video tutorial on how to do this?