1

update 1

i dont know much about but what i am trying to do is to play the video on both andriod/iphone through html5 as others have stated that i have to use tag in order to do that...

end update 1

updated: here is the code on my html page:

<video width="320" height="240" controls="controls"> <source src="movie.ogg" type="video/ogg" /> <source src="movie.mp4" type="video/mp4" /> <source src="movie.webm" type="video/webm" /> Your browser does not support the video tag. </video>

end update:

here is my code and don't seem its working for android and i am targeting android/iPhone devices. any help?

<noscript>
    <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3423ABDDC63" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
        <param name="src" value="http://hostname/images/Large.jpg" />
        <param name="href" value="http://hostname/mobile/videos/green.mp4" />
        <param name="target" value="myself" />
        <param name="controller" value="false" />
        <param name="autoplay" value="false" />
        <param name="scale" value="aspect" />
        <embed type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" src="http://hostname/mobile/videos/green.jpg" href="http://hostname/mobile/videos/green.mp4" target="myself" controller="false" autoplay="false" scale="aspect" />
    </object>
</noscript>
Jamie Hutton
  • 260
  • 3
  • 13
Nick Kahn
  • 19,652
  • 91
  • 275
  • 406
  • This is wrong in every way. Android uses completely different XML. Look at the documentation for the MediaPlayer class. – Amplify91 Apr 26 '11 at 18:36
  • but some says to use do you have anything to say? – Nick Kahn Apr 26 '11 at 18:37
  • There is no – Amplify91 Apr 26 '11 at 18:42
  • 1
    @Amplify: I think he's trying to do a web app, not a local app. Regardless, I don't believe Android (or iOS, for that matter) support the WebM format yet. – Kevin Coppock Apr 26 '11 at 20:16
  • @kcoppock you're right, I see that now. The question was tricky to understand! – Amplify91 Apr 27 '11 at 02:56

4 Answers4

2

Check the following link, there seem to be some workarounds, but WebM video is definitely not supported as of yet:

HTML5 <video> element on Android

Community
  • 1
  • 1
Kevin Coppock
  • 133,643
  • 45
  • 263
  • 274
1

Did you try hinting the mp4 video (moving the 'moov' atom at the beginning) with MP4Box or qt-faststart? Android can not play mp4 video progressively if the 'moov' atom is not at the beginning..

Muhammad Razib
  • 1,297
  • 9
  • 13
  • i dont know much about but what i am trying to do is to play the video on both andriod/iphone through html5 as others have stated that i have to use – Nick Kahn Apr 27 '11 at 14:58
  • @Abu Hamzah - Nop, not all mp4/ogv video will play in Android/Iphone in – Muhammad Razib Apr 27 '11 at 18:26
  • i am bit confused here, so you saying that i should onvert the video mp4 to ? what format?, `move the moov atom` i am not sure i understand what do you mean by that. thanks for your reply. – Nick Kahn Apr 28 '11 at 19:23
  • @Abu Hamzah - Not actually convert, just move the meta info to the beginning.. Here ( http://www.stoimen.com/blog/2010/11/12/how-to-make-mp4-progressive-with-qt-faststart/ ) are some info regarding this..Hope this will help. – Muhammad Razib Apr 29 '11 at 06:53
  • @Hasan, can you show me a sample code, since i havent worked on this so i have no idea from where to start. - thanks. – Nick Kahn Apr 29 '11 at 12:47
  • @Abu Hamzah - Have a look at here ( http://stackoverflow.com/questions/1711078/html5-video-element-on-android ). – Muhammad Razib Apr 29 '11 at 18:59
  • i did try the example, before posting this question and it did not work on my android phone any clue? – Nick Kahn May 04 '11 at 23:45
0

This is not at all how things are done in Android. For starters take a look at the MediaPlayer class: http://developer.android.com/reference/android/media/MediaPlayer.html

Also, take the time to look around the rest of the website. It is full of resources for learning how to get started with Android.

Amplify91
  • 2,690
  • 5
  • 24
  • 32
0

Your code fragment appear to be an HTML code. But iphone/android application is not an HTML code/pages! I think you should be more specific about what are you trying to do.

For android, application usually consist of JAVA code and UI declared in XML according to android schema (again, not HTML!). In this case, if you need to play video, you should use android API class android.media.MediaPlayer as Amplify91 said before (and this is nothing to do with HTML or XML). If you interested in developing application for android you should go to official android site for developers.

For iPhone, situation is similar, but instead of java you should develop application using object-C language and API for iPhone/iOS (different to Android API). I think there should be something similar to android's MediaPlayer (but i am not iPhone specialist).

But if your question not about apps, but about web page, that just should be opened in browser from iOS or android device, and about html, then answer is - you should use an HTML5 tag (default browsers from both devices supports HTML5). You can read more about this tag here

Zakus
  • 199
  • 12
  • 1
    i am just looking a way to embed videos that can play on andriod and iphone using html5 tag....and i try the sample shows on the link but it does not work, i will post the code in my above updated question. thanks. – Nick Kahn Apr 26 '11 at 19:52