This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Android and the fly likes To play video in android application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "To play video in android application" Watch "To play video in android application" New topic
Author

To play video in android application

Nehel Patel
Greenhorn

Joined: Feb 09, 2010
Posts: 21
Hi,

I want to play video file which is in '.AVI' format, placed in 'res/raw' folder of my android project.

Please send me the link which contains example for this or a code snippet so that I can implement this in my application.

Regards
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
According to the documentation (which also contains code examples that show how to play video) Android supports the 3GPP and MPEG-4 formats, so you'll have to convert the file to one of those formats.


Ping & DNS - updated with new look and Ping home screen widget
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369

Nehel Patel wrote:
...Please send me the link which contains example for this or a code snippet so that I can implement this in my application.

Regards


After you have your file converted to a compatible format you can play it using MediaPlayer or a VideoView.
For starters you can take a look at code samples under:
SDK_HOME\platforms\android-2.0\samples\ApiDemos\src\com\example\android\apis\media


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Nehel Patel
Greenhorn

Joined: Feb 09, 2010
Posts: 21
Thanks for the reply ulf and Monu...

I will convert it first ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To play video in android application
 
Similar Threads
Media format for video streaming
SWF (flash)files support.
Playing Video files on javaFx (embedded on html page, and pop-up version)
Java base WEB video player
Playing video file