Android HTML5 Video

1,001 views
Skip to first unread message

MikeMc

unread,
Mar 4, 2011, 11:33:53 AM3/4/11
to phonegap
Hi all, I would like to have my html video play in full screen mode
when clicked and return to the application after the video is
completed, or the user pushes "back' or "done". I am creating an app
and running into an issue with my PhoneGap compiled android app not
playing html5 video files. The issue seems to be in the tied to the
"type='video/mp4'" tag.

If I use the following tag...
<video id="example_video_1" poster="pages/test.png"
width="120" height="80" onclick="this.play();">
<source src="http://savannahchristian.com/mobile/pages/
android.mp4" />
</video>

It does NOT include the type tag in my video tag it functions properly
viewing it on the web. However it does NOT work properly within the
compiled android app on the device OR the android emulator. Loading
the video tag in the android emulator or compiled on an actual android
device causes the app to crash.

On the flip side if I include the "type" and use the following tag....
<video id="example_video_1" poster="pages/test.png"
width="120" height="80" onclick="this.play();">
<source src="http://savannahchristian.com/mobile/
pages/android.mp4" type="video/mp4" />
</video>

It does NOT play in either the web app or the compiled android app, I
however do not have issues with the compiled app crashing.


I have been working on this issue for a few days and hope that i can
get it resolved shortly I am using PhoneGap 0.9.4 and vanilla html5.
If i could get any guidance or direction I would greatly appreciate
it.

MikeMc

unread,
Mar 7, 2011, 8:39:45 AM3/7/11
to phonegap
I am still struggling with this, any input from anyone?

-Mike

Ari

unread,
Mar 7, 2011, 4:45:29 PM3/7/11
to phonegap
I too have an example that works well in the android browser but not
in Phonegap/WebView. Unfortunately, I don't have much useful to add
at this point.

There seems to be a handful of posts around about this. This one
yielded the most interesting info:

http://groups.google.com/group/phonegap/browse_thread/thread/6e8307e57d857cdd/d1b921d48a53759f

One responder suggests that this has been fixed in Phonegap 0.9.4 but
I am using that version and experiencing the same issue. When I try
the later "setDownloadListener" fix, my app compiles but crashes on
launch.

MikeMc

unread,
Mar 8, 2011, 8:35:14 AM3/8/11
to phon...@googlegroups.com
Thanks for your response, however like you I am experiencing the same crashing issues after compiling on the device.

I am still looking into resolving this, if I find a solution I will get it posted.

Ari

unread,
Mar 29, 2011, 6:00:18 PM3/29/11
to phonegap
Mike,

There was a solution posted on the thread I linked to above that
solved the problem for me today.
Reply all
Reply to author
Forward
0 new messages