Dec-04-2009 : This post is outdated. Please look here for updated code
Here is a screen shot.
Notes
- You can specify a directory path or a remote URL in the edit box
- You can specify just an mp3 file to play music only
- Choose any 3gp file from http://daily3gp.com/ to view videos
- The 4 buttons are for play, pause, reset and stop
- When you specify a http or https url, we save the url contents to hard disk first and then play it
- All the leg work was done by dahui. Many thanks!!
- The icons are from here
- MediaPlayer does not yet support any remote url’s or MPEG4 video AFAICT
Here’s the code
package org.apache.android; import android.app.Activity; import android.graphics.PixelFormat; import android.media.MediaPlayer; import android.media.MediaPlayer.OnBufferingUpdateListener; import android.media.MediaPlayer.OnCompletionListener; import android.media.MediaPlayer.OnErrorListener; import android.os.Bundle; import android.util.Log; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.webkit.URLUtil; import android.widget.EditText; import android.widget.ImageButton; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; public class VideoPlayer extends Activity implements OnErrorListener, OnBufferingUpdateListener, OnCompletionListener, MediaPlayer.OnPreparedListener, SurfaceHolder.Callback { private static final String TAG = "VideoPlayer"; private MediaPlayer mp; private SurfaceView mPreview; private EditText mPath; private SurfaceHolder holder; private ImageButton mPlay; private ImageButton mPause; private ImageButton mReset; private ImageButton mStop; private String current; /** * Called when the activity is first created. */ public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); // Set up the play/pause/reset/stop buttons mPreview = (SurfaceView) findViewById(R.id.surface); mPath = (EditText) findViewById(R.id.path); mPlay = (ImageButton) findViewById(R.id.play); mPause = (ImageButton) findViewById(R.id.pause); mReset = (ImageButton) findViewById(R.id.reset); mStop = (ImageButton) findViewById(R.id.stop); mPlay.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { playVideo(); } }); mPause.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if (mp != null) { mp.pause(); } } }); mReset.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if (mp != null) { mp.seekTo(0); } } }); mStop.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if (mp != null) { mp.stop(); mp.release(); } } }); // Set the transparency getWindow().setFormat(PixelFormat.TRANSPARENT); // Set a size for the video screen holder = mPreview.getHolder(); holder.setCallback(this); holder.setFixedSize(400, 300); } private void playVideo() { try { final String path = mPath.getText().toString(); Log.v(TAG, "path: " + path); // If the path has not changed, just start the media player if (path.equals(current) && mp != null) { mp.start(); return; } current = path; // Create a new media player and set the listeners mp = new MediaPlayer(); mp.setOnErrorListener(this); mp.setOnBufferingUpdateListener(this); mp.setOnCompletionListener(this); mp.setOnPreparedListener(this); mp.setAudioStreamType(2); // Set the surface for the video output mp.setDisplay(mPreview.getHolder().getSurface()); // Set the data source in another thread // which actually downloads the mp3 or videos // to a temporary location Runnable r = new Runnable() { public void run() { try { setDataSource(path); } catch (IOException e) { Log.e(TAG, e.getMessage(), e); } mp.prepare(); Log.v(TAG, "Duration: ===>" + mp.getDuration()); mp.start(); } }; new Thread(r).start(); } catch (Exception e) { Log.e(TAG, "error: " + e.getMessage(), e); if (mp != null) { mp.stop(); mp.release(); } } } /** * If the user has specified a local url, then we download the * url stream to a temporary location and then call the setDataSource * for that local file * * @param path * @throws IOException */ private void setDataSource(String path) throws IOException { if (!URLUtil.isNetworkUrl(path)) { mp.setDataSource(path); } else { URL url = new URL(path); URLConnection cn = url.openConnection(); cn.connect(); InputStream stream = cn.getInputStream(); if (stream == null) throw new RuntimeException("stream is null"); File temp = File.createTempFile("mediaplayertmp", "dat"); String tempPath = temp.getAbsolutePath(); FileOutputStream out = new FileOutputStream(temp); byte buf[] = new byte[128]; do { int numread = stream.read(buf); if (numread <= 0) break; out.write(buf, 0, numread); } while (true); mp.setDataSource(tempPath); try { stream.close(); } catch (IOException ex) { Log.e(TAG, "error: " + ex.getMessage(), ex); } } } public void onError(MediaPlayer mediaPlayer, int what, int extra) { Log.e(TAG, "onError---> what:" + what + " extra:" + extra); if (mediaPlayer != null) { mediaPlayer.stop(); mediaPlayer.release(); } } public void onBufferingUpdate(MediaPlayer arg0, int percent) { Log.d(TAG, "onBufferingUpdate called ---> percent:" + percent); } public void onCompletion(MediaPlayer arg0) { Log.d(TAG, "onCompletion called"); } public void onPrepared(MediaPlayer mediaplayer) { Log.d(TAG, "onPrepared called"); } public boolean surfaceCreated(SurfaceHolder surfaceholder) { Log.d(TAG, "surfaceCreated called"); return true; } public void surfaceChanged(SurfaceHolder surfaceholder, int i, int j, int k) { Log.d(TAG, "surfaceChanged called"); } public void surfaceDestroyed(SurfaceHolder surfaceholder) { Log.d(TAG, "surfaceDestroyed called"); } }
Hi,
Thanks for your code, It works like a charm but i need to know one thing where the temp file is created and is it not necessary to delete the temp file every time when the media is completed
Comment by Navas — December 31, 2007 @ 1:39 am
Hey, How did you all guys worked this code? I’m not able run any video using this code. It runs on my device. when i play with the sdcard path ( file:///sdcard/a.mp4), it doesn’t run my video there. And i kept that as with default path also didn’t play any video. But i want to run a video which is from Raw folder available in project resource using this code…Can it be done? If yes, how? Please advice asap.
Comment by John — October 16, 2009 @ 7:12 am
Hey could u please send code in a zip file. thanks in advance
Comment by abhi — September 29, 2010 @ 11:35 pm
Hi,
I tried to run the code but I cannot import the project in Eclipse and when I create a new project and I try to copy the unzipped files over the created ones, some errors occur.
Can you provide more informations on how to run this project?
Thank you
Comment by Liviu — December 31, 2007 @ 9:07 am
[…] has also made the source available, which can be found here. SHARETHIS.addEntry({ title: “A New Media Player for Android”, url: […]
Pingback by A New Media Player for Android | DroidSpot — December 31, 2007 @ 11:02 pm
Hi,
I download the application and unable to run the same in eclipse. It showing some exception in Androidmanifest.xml file.
It showing “package ‘ org.apache.android’ does not exist! “. what i suppose to do for this.
Thanks,
Bala.
Comment by Balaji — January 24, 2008 @ 5:03 am
Hi,
I have created one more file in that i added all the files present in the VideoPlayer.zip.
Finally i got something, but with simple text box alone, nothin other than that is comming .
Kindly help me in this regrds.
Bala.
Comment by Balaji — January 24, 2008 @ 6:07 am
Hi,
Is there any way to start video playback from a service?
Comment by Rohit — January 28, 2008 @ 1:38 am
Thanks for a great demo!
Simple, elegant and well-written.
Comment by Amos — January 31, 2008 @ 4:48 pm
hi,
Pls cud u send me code in a zip file pls. thx in advance
Comment by abhi — September 29, 2010 @ 11:39 pm
Hi,
Could you please update this to work with M5.
Thanks,
Regards
Comment by gary silva — February 17, 2008 @ 9:44 pm
hi,
Pls cud u send me VideoPlayer code in a zip file pls. thx in advance
Comment by abhi — September 29, 2010 @ 11:40 pm
Very nice example. For those who have problem to run it:
How it is written one will need to use HVGA-L mode of emulator or to edit the following line inside onCreate:
holder.setFixedSize(400, 300);
to something less ambitious like 200×200.
Comment by Filip Bulovic — February 24, 2008 @ 1:45 pm
Hi,
Can you update this player to M5 please!
Tanks.
Andrew
Comment by Andrew — March 5, 2008 @ 2:50 pm
Thanks for a great demo!
Comment by Deri — March 23, 2008 @ 1:06 pm
please give me video player code in zip thanks in advance
Comment by akhilesh shahu — May 3, 2012 @ 7:11 am
Hi,
Could you update this player to M5 please!
thanks
Comment by peng — April 24, 2008 @ 10:13 pm
Hi .
I can’t play the video from the local . the error as follows:
Duration: ===> -1
Could you help me check it .Thansk
Thanks.
Comment by peng — April 28, 2008 @ 2:35 am
peng i am also gtting th same problem … as in Dalvik debug monitor showing th duration as -1
Comment by Dinesh — May 12, 2008 @ 7:48 am
hv u found the solution for tat .. if so help me out ..
Comment by Dinesh — May 12, 2008 @ 7:49 am
Hi,
This code is showing some errors.
Actually the setCallback method is not avalable in m5. And the surfaceCreated method’s return type has been changed.
i updated these errors. but am not able toplay any file. Please help me.
Comment by radhika — May 13, 2008 @ 7:29 am
may i have a look at your main file? thanks!
Comment by abc — May 20, 2008 @ 10:46 pm
hi,
Pls cud u send me VideoPlayer code in a zip file pls. thx in advance.
Comment by abhi — September 29, 2010 @ 11:41 pm
hi……
i have the proble with the video view i will post my code down …….its not working…
[syntax=”java”]
Java:
import android.net.Uri;
import android.os.Bundle;
import android.widget.VideoView;
public class musicplayer extends Activity {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
VideoView vv=(VideoView)findViewById(R.id.vdoplayer);
// MediaPlayer mp=new MediaPlayer();
// Uri myUrl = Uri.parse(“http://207.210.108.32/Music/Crazy.3gp”);
// vv.setVideoURI(myUrl);
vv.setVideoPath(“http://207.210.108.32/Music/Alarm.wmv”);
vv.start();
}
}
this is the java file andd xml given below
XML:
]syntax=”xml”]
but is not working…..i was trying with the my own server….it is getting in browser….but not working with the video view…….can any body help me…….
or can any body tell me how to access and play video on the emulator …..
please…
with thanks bins……..
Comment by bins — May 22, 2008 @ 6:43 am
Hi,
thanks a lot for that example!
1. I can play videos from the internet when i remove the extra thread and start & prepare the player without it. Do you really need an extra thread? The GUI is reacting nevertheless, so whats the advantage?
2. How can i play local files? I put them into the resource folder (res/raw/), but no path which i enter in the textfield seem to be correct.
thanks for help
Comment by alex — May 28, 2008 @ 7:58 am
hi,
Pls cud u send me VideoPlayer code in a zip file pls. thx in advance..
Comment by abhi — September 29, 2010 @ 11:41 pm
Ok,
i figured out a way to play local videos. If you play them from the Internet, they get stored in /tmp/… I just copied a video over eclipse FileExplorer into that directory and played the url /tmp/filename. But i donĀ“t know how to play files within the resources directory. Most likely they are stored in the app.apk. Why canĀ“t i play them with /res/raw/filenname?
Comment by alex — May 28, 2008 @ 10:19 am
Hi,
This is really great and thanks for sharing this code. but
can anybody tell me where is the zip file for this source code?
else let me know how to run this code in android emulator?
Thanks,
Souvik
Comment by souvik — June 16, 2008 @ 2:37 am
Problem: Not able to load the project into Eclipse.
when I want to add this project as new project from existing source and given the path for this folder , its showing an error msg:” No activity name defined in D:\android\android_workspace\VideoPlayer\AndroidManifest.xml.”
and not able to load this project.
Please help me to load this project to run it in emulator.
Thanks,
Souvik
Comment by souvik — June 16, 2008 @ 4:03 am
Hi,
I could resolve all the errors. I’m finding problem at the run time. I’m getting NullPointerException error. Found that the error is due to
mPreview = (SurfaceView) findViewById(R.id.surface)
mPreview is null.
Likewise, mPath, mPlay, … are also null.
Can anyone suggest how to overcome this issue???????
Celia
Comment by celia — June 20, 2008 @ 4:02 am
Hi, Change the id to android:id in main.xml.
You will see the layout by the above modification.
Comment by Prahlad T — July 7, 2008 @ 1:28 am
hi there..
from above pasted code.. when i did some changes at line number 122.. i just cut that line and put out of thread then only it is working fine for total video lenght.
otherwise if i keep it as it is in thread then only very small fraction of video from initial part is playing then after it is terminating application…
can you help me in that .,…?
Comment by nekin — July 9, 2008 @ 5:43 am
Does anybody here know a valid and updated code that works fine? š¦
Comment by ricardo souza — July 15, 2008 @ 7:21 am
I have some problem on
final String path = mPath.getText().toString();
when I run the program..
java.nullpointer exception occur..
can someone help me?
thx in advanced
Comment by hendrik — July 24, 2008 @ 9:15 pm
Hi!,
Comment by name — August 31, 2008 @ 10:40 pm
Hi,
I can’t see the source code. I got web page not found exception if I’m trying to download the source code.
Can you plz… anybody share the source code ?
Thanks in advance.
Comment by Yasmin — October 20, 2008 @ 10:53 pm
The source and pictures are no longer available. If you still have the source, could you please email it to me ? Thank you !
Comment by Tim — October 24, 2008 @ 11:25 am
If you got all the codes then please email to me….i in very much need of that code.
Comment by vijay — November 16, 2009 @ 4:08 am
Hallo ,
great Work ,but i can’t play it with the 0.9 Beta ,Could you please help me and mail me this .
thanks
Comment by Ami — November 5, 2008 @ 9:47 am
hi,
i cant able to download the code canu pls share the code
i have copied and run it i am getting error
MediaPLayer :Error(-38,0)
Error(-1,0)
will u pls help me ou of this
thanxin advance
Comment by babavali — November 21, 2008 @ 1:28 am
hi,
where is the source file? I got web page not found exception 404 whie downloading the source code.
can anybody share the code pls….
my id is alpesh.harsoda@gmail.com
thnks in advance.
Regards,
Alpesh Harsoda
Comment by Alpesh — December 8, 2008 @ 4:34 am
Hi,
I tried this code by make some necessary changes. but not working can you please help me. Its giving the NullPointerException at surface view,giving error(-38,0). Some where it showing Status=#fffffff
Comment by ankit somani — December 13, 2008 @ 3:42 pm
Can anybody share the source code?
I couldn’t download the code.
Please…
my email is cindyduh@nthu.us
thanks a lot!
Comment by cindy — December 18, 2008 @ 7:45 am
Please share the Video Player Code .. Since it is not downloadable from this site
Comment by Nikhil — January 25, 2009 @ 3:52 am
my email id is nikhilbhandary@gmail.com
Please share the Video Player Code .. Since it is not downloadable from this site
Comment by Nikhil — January 25, 2009 @ 3:56 am
Can anybody please share the source code? The download link is not working. email: high2freq@yahoo.com
Thanks.
Comment by Andrea — January 26, 2009 @ 3:40 am
Yes, I would appreciate the code also. My email is aphilsmith@gmail.com
Thanks!
Comment by Phil — January 26, 2009 @ 3:17 pm
can you please email me the ZIP file as its no longer downloadable from this site?
i desperately need it.
Comment by anushka — January 27, 2009 @ 1:04 pm
give me your id.. i can send it on your id…
Comment by nextcome — May 6, 2010 @ 1:57 am
please mail the code to me as well. asap !!!
Comment by shailesh — November 14, 2010 @ 11:21 pm
please email me the ZIP file as its no longer downloadable from this site?
i desperately need it.
Comment by anushka — January 27, 2009 @ 1:05 pm
can anybody pleaseeeeeee email this file to me… as i’m not able to download the zip file from this site…PLeaseeeeee
email : varsha.uni@gmail.com
Comment by Varsha — February 2, 2009 @ 6:11 pm
Many thanks to this code.
The lik to zip file is not available. Is this been removed from the server?
I am trying use the code mentioned above. I could not compile it. It saying R.ID is not recognized. Can someone give me strps to compile this code. What are other files needed or what declaration are needed to compile this successfully?
Thank you for your time.
Comment by vishy — February 3, 2009 @ 1:39 am
Dear, Can some one share the code to update the Progress bar of the Media playback?
Comment by vishy — February 5, 2009 @ 10:23 am
Please share source code with me, as this has been removed from server. my email id is jayesh.thadani@gmail.com
Comment by jayesh — February 5, 2009 @ 11:52 pm
The link to the sourcecode does not exist. Can you share the latest zip file at pbdnit@yahoo.com pls ?
Comment by Gate — February 13, 2009 @ 2:51 pm
Can anybody please share the source code? The download link is not working. email: mrcararia@gmail.com
Thanks.
Comment by Mr. Cararia — February 16, 2009 @ 6:00 am
Hey guyz.. plz i need this code .. so could u ppl send this code on this email add: javeeduddin.b@hotmail.com
Comment by Javed — February 20, 2009 @ 12:14 am
Can anybody please share the source code? The download link is not working. email: smartcelldebono@yahoo.com
Thanks.
Comment by Smartcell — February 26, 2009 @ 12:21 pm
The download able zip code is not available on this link. can you pls send it to me in mail? muthusankarm@hotmail.com
Comment by muthu — March 3, 2009 @ 6:44 am
Hey, could you please send me(or update the download link) the source code of this app? I need it for a future-android-streaming app i’m developing. Thanks in advance! (Email: tdr.popa@gmail.com)
Comment by tudor — March 8, 2009 @ 11:41 am
Please share source code with me, as this has been removed from server. my email id is linesaver@gmail.com
Comment by linesaver — March 9, 2009 @ 12:55 am
some to me… where is the source š
please info to: ilovesinai@gmail.com
Comment by chris — March 9, 2009 @ 4:32 am
pls send me the source code to shaks@ureach.com
Comment by shakeel — March 10, 2009 @ 10:09 pm
Hi their,
I would like to have the Video/Musik player, so please can anyone send me the source code. e-Mail: m.kruemmling@googlemail.com
Comment by Michael — March 25, 2009 @ 9:15 am
Please share source code with me, as this has been removed from server. my email id is devadrita.harh@gmail.com
Comment by Devadrita — March 28, 2009 @ 1:14 pm
cant download source from that link -.-” can u send to my email? embedzit@gmail.com
thx lotz
Comment by suesi tan — March 30, 2009 @ 3:43 am
Hi, can’t download the Zip-File. Can pleas send me the code to gurkenlager@googlemail.com
Thanks!!!
Comment by Gurke — April 2, 2009 @ 8:37 am
I can’t download the zip file from the link. Please send me the file to hsyun@sktelecom.com Thank you in avanced!
Comment by Harrison — April 23, 2009 @ 2:13 am
Please share the code to me at my email id: apanwar@live.com as it is not downloadable from the link.
Thanks,
Amit
Comment by Amit Panwar — April 24, 2009 @ 9:53 am
I canāt download the zip file from the link. Please send me the file to emily.ting@ecs.com.tw Thank you in avanced!
Comment by emily — April 29, 2009 @ 7:41 am
Hi,i’m starting learning android now and this is really helpful to me,thanks for making it public.
Can i have the source code at fidevel@yahoo.com,since its not downloadable from the link?Thanks in advance!
3m
Comment by fidevel — April 30, 2009 @ 8:23 am
nice work man can i have the source code at my email id
here it is kl_jander@yahoo.com thanks
Comment by ben — May 1, 2009 @ 4:40 am
Can anybody please share the source code? I desperately need it. thanks.
recl24@hotmail.com
Comment by rudi — May 4, 2009 @ 1:50 am
Can anybody please share the source code? I desperately need it. thanks.
hinty_ollo@hotmail.com
Comment by sabrina — May 17, 2009 @ 10:01 pm
I can’t download source code. Please Share the source code..
lakdong@hotmail.com
Comment by ldsung — May 18, 2009 @ 1:34 am
Can you please share the source code ? Thanks a lot !
Comment by Jesslyn — May 19, 2009 @ 5:23 pm
I canāt download source code. Please Share the source code..
bhwon@pyroworks.co.kr
Comment by bhwon — May 20, 2009 @ 12:47 am
I canāt download source code. Please Share the source code. Thanks a lot.
color47@gmail.com
Comment by Color — May 21, 2009 @ 4:20 am
Can somebody send source zip file to me?
I am stuck with running live video streaming part š¦
TIA
Comment by Aahna — May 28, 2009 @ 3:26 am
Can you please share the source code ? Thanks a lot !
Comment by poveteen — June 1, 2009 @ 10:28 pm
Can you please share the source code ? Thanks a lot !
poveteen@gmail.com
Comment by poveteen — June 1, 2009 @ 10:29 pm
other solution pages from davanum have the zip file downloadable. Any particular reason why this link is disabled?
It would be great help if people who got it earlier upload the same zip somewhere and share the link for helping others.
Regards,
Aahna
Comment by Aahna — June 3, 2009 @ 1:12 am
[…] serie de manuales (http://www.android-spa.com/manuales.php)Reproductor multimedia (https://davanum.wordpress.com/2007/12/29/android-videomusic-player-sample-from-local-disk-as-well-as-…) Posted: sĆ”bado, 06 de junio de 2009 10:52 por Thempra Archivado en: Software […]
Pingback by Thempra.NET : Enlaces para iniciarse en la programacion sobre Android — June 6, 2009 @ 4:19 am
Can anybody please share the source code? I desperately need it. thanks.
shiihs5286@gmail.com
Comment by Skono — June 9, 2009 @ 1:10 am
I canāt download the zip file from the link. Please send me the file to shiihs5286@gmail.com Thank you in avanced!
Comment by shiihs — June 9, 2009 @ 1:42 am
hey hi buddy …
cn i get source code of same.. it will be gr8 help fr me if i get code .. thnx in advance ..:)
Comment by tushar — June 9, 2009 @ 9:35 am
Code: http://rapidshare.com/files/92645847/VideoPlayer.rarl
Source
http://www.android-spa.com/verManual.php?id=47
Comment by Adrian — June 9, 2009 @ 10:00 am
how to get those 4 image button displayed?
Comment by alan — July 2, 2009 @ 3:17 pm
very well presented. thank you.
can you please help ? I want to install the android apk in a real device. how? procedure?
Comment by mathew — July 28, 2009 @ 6:18 am
Has anybody extended on this design? I listen to folder based audio courses and most media players are not very good at helping me managing them.
I really like that this app starts with a folder view and it would be great if you could just say “play this folder” so that when one file finished it would load and play the next file. Even better if it remembered which file you were on and the location within that file per directory.
And of course work with the bluetooth control buttons on my stereo headset and behave nicely when switching from audio to phone and back again.
Any ideas where I can find an app like that?
Comment by Dave — August 9, 2009 @ 8:21 pm
hallo,
I’m programming with Eclipse IDE and using the Android Emulator.I have make a copy and paste of this code, but I’m getting some errors with the class R.id.Thats is the class R.Java that was generated by creation of the application. I don’t know what is wrong on it. If it is correct what could be the problem. Could somebody help me ?
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
}
Comment by stephane — August 13, 2009 @ 7:44 am
hi, the download link is failed, could u send me the source file? i think it can help me to develop code about media player. thanks. my email: maestro1230@gmail.com
Comment by Brian — September 14, 2009 @ 7:24 am
Hey! can someone share the src with me? markmathis@gmail.com
Comment by mark mathis — September 22, 2009 @ 5:54 am
Hi,
i cannot find the source files! can anyone please mail it to me(bhavyaprakash@gmail.com)
Thanks a ton!
Comment by Bhavya — September 23, 2009 @ 5:24 am
Hi
can any one share the APK file and the source code too
pl. send to sayiram.kothuri@gmail.com
Comment by sram — October 10, 2009 @ 3:02 am
Hey! can someone share the src with me? kimjs0928@hanmail.net
Comment by kim — October 26, 2009 @ 11:40 am
will you please send me the source and apk to my email address as it giving some problem to download.
Comment by gour — November 10, 2009 @ 12:02 pm
Hi
Can u please mail me the source code to my email address.
Thanks in advance
Comment by Urgent — November 20, 2009 @ 5:40 am
Hi ,
I am unable to download videoplayer.zip
is it moved ?
Comment by vasundhar — December 2, 2009 @ 4:24 am
Hi,
I’m unable to download videoplayer.zip, too. Could you please re-upload or send to me by email: ngoquanghuy.info@gmail.com
Thanks for all!
Huy
Comment by Huy — December 20, 2009 @ 10:30 pm
Hi,
Iām unable to download videoplayer.zip, too. Could you please re-upload or send to me by email : rocker0423@nate.com
Thanks for all!!!
Comment by red — December 25, 2009 @ 2:19 pm
Hello all,
When I tried to build the code in eclipse I got the following error. Can you pls tell me what to do . I am a newbie to adroid and java as well.. š¦
Description Resource Path Location Type
R.id cannot be resolved VideoViewDemo.java /VideoViewDemo/src/org/apache/android/media line 53 Java Problem
battus
Comment by battus — January 6, 2010 @ 1:07 am
Two changes guys………
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
set this in the surface holder and pass the holder to
mediaplayer function
mp.setdisplay(holder);
it will work like magic š
Comment by deepak venugopal — January 8, 2010 @ 6:08 am
Hi guys,
I couldn’t download source code .please zip and mail it to me. ramesh_siva12@yahoo.com
Comment by ramesh12 — January 19, 2010 @ 5:11 am
Hi,
Iām unable to download videoplayer.zip, too. Could you please re-upload or send to me by email : javadianjp@yahoo.co.jp
Thanks for all!!!
Comment by javadian — January 28, 2010 @ 9:13 am
Hi,
Iām unable to download videoplayer.zip, too. Could you please re-upload or send to me by email : kimlh2@nate.com
Thanks for all!!!
Comment by good guy — February 10, 2010 @ 12:19 am
Hi,
i cant download VideoPlayer.zip file
please send me email : rully.hasibuan@ymail.com
thx
Comment by Rully — February 10, 2010 @ 7:31 am
Hi,
i cant download VideoPlayer.zip file
please send me email : pmskiran@purpletalk.com
Thanks..
Comment by Kiran PMS — February 13, 2010 @ 10:28 am
Hello! I also can’t download the VideoPlayer.zip. Kindly email it to me: sarahmae_05@yahoo.com. Thanks in advance! š
Comment by sarah — February 28, 2010 @ 9:16 am
Hi,
I am unable to download this zip file.
Can u tell corresponding another link…
Comment by sachin — March 25, 2010 @ 8:56 am
when i try to download the vidioplayer.zip then i couldn’t download it.
can u help me.
i u have then plz mail me @ muneshs@geniusport.com
Comment by munesh — April 7, 2010 @ 3:58 am
Look here:
the similar code
Comment by Valera — April 14, 2010 @ 11:31 am
this code is OK but you should also explain them for naives like me.
Comment by Vicky — May 1, 2010 @ 11:43 pm
if anyone want that zip code.. write me on this id nextcome@gmail.com. I will help you on it.
Comment by nextcome — May 6, 2010 @ 2:06 am
Hello! I also canāt download the VideoPlayer.zip.
Kindly email it to me: hslee@edicon.net. Thanks in advance!
Comment by Lee HyunSoo — May 13, 2010 @ 7:37 am
Great job, congratulation š
Can you send me the .zip to try it ?
Thanks a lot
Comment by Ro — May 14, 2010 @ 3:49 am
sorry, my mail rowan05@gmail.com
Comment by Ro — May 14, 2010 @ 3:50 am
[Post New] posted Yesterday 4:09:17 PM private message
Quote
can anyone kindly send me android apk file for playing videos stored in sdcard with flashplayer on emulator??
Comment by hema — June 16, 2010 @ 11:06 pm
I am new to android, I want to go through code for better understanding, Can anyone send me the source code, I am not able to download it from the above link praveenbn_83@yahoo.com
Thanks in advance….
Comment by Praveen — June 22, 2010 @ 11:36 pm
Hi, I canāt download the zip file from the link. Can you please send me the file to sujithcp@gmail.com Thank you in avanced!
Comment by sujith — July 14, 2010 @ 1:43 pm
Hi,
Please reupload the source for this somewhere.
Cheers
Comment by Stu — July 20, 2010 @ 11:57 pm
unable to play any file…it does not play the 3gp file and for some other formats it gives error…
i have tried using landscape mode also
Comment by chotachetan — August 23, 2010 @ 6:07 am
I am new to android, I want to go through code for better understanding, Can anyone send me the source code, I am not able to download it from the above link mcrtkim@gmail.com
Thanks in advanceā¦.
Comment by kim, HS — August 26, 2010 @ 9:02 am
Hi.
Please, send this zip file to me. thanks in advance.
Comment by helen — September 9, 2010 @ 8:43 pm
Hi.
Please, send this zip file to me. thanks in advance.
–> My email address is ‘hllim@naver.com’.
Comment by helen — September 9, 2010 @ 8:44 pm
can u sent the zip to evanhackborn@gmail.com
Comment by evan — September 10, 2010 @ 3:06 am
Hi I can’t download sourcecode.Can you please send me the file to ninechad@hotmail.com .Thank you
Comment by ninechad — October 10, 2010 @ 1:36 am
Thanks for your code
It is working on my HTC android 1.6.
I now can load video from the sd card.
Thanks a lot !!!
Comment by Sanun — October 12, 2010 @ 10:10 pm
Hello, same here, could you send me the ZIP. Thanks a lot!!
Mark
Comment by Mark — October 14, 2010 @ 3:48 am
I face this problem while running this example…
“java.net.SocketException address family not supprted by the protocol…”
Comment by Himanshu — November 1, 2010 @ 7:14 am
Hi Please send me the zip file in my email: luther_martina@yahoo.com. Thank u!
Comment by martina — November 17, 2010 @ 11:11 am
Please send me the zip file in my email: richard.helak@gmail.com
Thank you.
Comment by riso — January 12, 2011 @ 4:17 pm
Hi,
Please email me the Source and APK files as the link for VideoPlayer.zip is not available.
Thanks in advance
Kind regards
Mel
Comment by Mel — May 10, 2011 @ 4:50 am
Please provide me a URL of video that works, when I run this code I can hear an audio but video is not displayed.
Comment by ankur — May 24, 2011 @ 1:47 am
hi
i am raghu working as android application developer.
i need mediaplayer application, can u send me to my email: ambidi2raghu@gmail.com
Comment by Raghu ambidi — June 15, 2011 @ 11:50 pm
Hi Please send me the zip file to my email: tommydam1@gmail.com
Thank you very much.
Comment by Tommy — June 16, 2011 @ 1:36 pm
Hi I canāt download sourcecode.Can you please send me the file to rohaneee@gmail.com .Thank you
Comment by rohan singh — June 20, 2011 @ 8:07 am
Hi,
I cannot find the source files!, the download link is broken. Can anyone please mail to, edinettedrms@gmail.com
Thanks
Comment by ppk — June 27, 2011 @ 6:16 am
Please send me the zip file in my email: tanuja.raavi@gmail.com
Thank you.
Comment by Tanuja — July 16, 2011 @ 2:23 am
Can you please help me on how to store a live video into a buffer and then from buffer into a file.I am using a camera to capture the video which i want to store in a buffer and then into a file.
Comment by pawan — August 17, 2011 @ 2:15 am
Please send me the zip file in my email: koreait@paran.com
Thank you.
Comment by JI SEOK WOO — August 18, 2011 @ 4:59 am
Hello, same here, could you send me the ZIP. Thanks a lot!!
Comment by Gaurav — August 19, 2011 @ 2:16 am
Please send me the zip file in my email: monsieur.pub@laposte.net
Thank you
Comment by sgo35 — August 24, 2011 @ 7:22 am
Please send me the zip file in my email:vahmadtamimi62@gmail.com
Thank you.
Comment by Tamimi — August 24, 2011 @ 5:37 pm
Please send me the zip file in my email: thanhmc1@gmail.com
Thank you.
Comment by kikura — August 25, 2011 @ 5:21 am
Wow, there has been comments since 2007 of people asking for the code to be sent to them. Clearly, that’s not going to happen
Comment by Fail Whale — September 4, 2011 @ 8:38 pm
hello, i tried this example. The code has no error but when i run on emulator it says that application stopped unexpectedly. There is no error message on console.
How to fix this?
Comment by Dhruv — October 26, 2011 @ 12:55 pm
hi sir ur coding is good but ur source code but not import the eclipse so how to run this source code plz tell me and how to write this code in to eclipse give me the explanation
Comment by rambabu — October 28, 2011 @ 12:48 am
hi
i have imported d folder in my eclipse workspace….n it is working perfecly…bt d thing i want to ask is that …where should i add songs and hw to link it……as it is not playing any song…..kindly reply asap….i need it urgently…..
thanks
rafia
Comment by rafia — November 1, 2011 @ 1:52 am
Actually, your demo just work: download file audio (video) from network to store in local file, then play it. Can you tell me about streaming audio on android through rtsp protocol
Comment by CTT — December 6, 2011 @ 2:52 am
Please send me the zip file in my email:nagireddy454@gmail.com
Thank you.
Comment by Nag — December 27, 2011 @ 2:56 am
Hiiiiiiiiiiii …. plz i have a problem in which i am trying to play a video file which put in NAS ftp server and when i am trying to play i am unable to play … how i can do it plz reply me its urgent ……..
Sorry for my english
thanks….
Comment by Arun Yadav — January 23, 2012 @ 1:54 am
I am using android sdk version 4.0.3 with eclipse sdk version 3.6.2. I am able to see the edittext box with thefile name i put in the code. I see the buttons. The file is located on the local machine. But the video does not play. All functionality and eventlistners do fire. What am I missing. Any help will be appreciated.
Dollar
Comment by Dollar — January 27, 2012 @ 5:21 pm
The above code does not work in my case as I wana stream from ipcam using wifi router in my case
the address is rtsp://192.168.1.155:554/3g
Comment by EngrSofty — March 16, 2012 @ 2:21 am
hi pls tell how to change next track.
Comment by Pandian Ind — March 18, 2012 @ 12:11 pm
how to play live streaming video
Comment by lucky — May 12, 2012 @ 6:26 am
[…] […]
Pingback by player andoird - Forum Android Italiano — June 27, 2012 @ 4:10 am
hi
code u write i can understand but can u give me xml file of this code so i can guess the layout of this…i m unable to run this code i want xml file……..
Comment by mahima gupta — July 10, 2012 @ 6:14 am
Hi,
I have to download the image/Video from WCF Rest Service to AndroidApp.
From Rest service, I am sending the Image in JSON(base64 format).
In Android, I am not able to retrieve that JSON string.
I am getting errors in ” JSONObject Details = new JSONObject(Tempbuffer); ”
The errors are: “Timed out Exception” & “Unterminated character at 122449 position.”
Note: 122449 is the Last character in JSON string
Here is My code..
DefaultHttpClient client = new DefaultHttpClient();
str=tvItemName.getText().toString();
HttpGet request = new HttpGet(DETAILS_URI + str);
request.setHeader(“Accept”, “application/json”);
request.setHeader(“Content-type”, “application/json”);
//get the response
HttpResponse response = client.execute(request);
HttpEntity entity = response.getEntity();
if(entity.getContentLength() != 0)
{
// stream reader object
Reader DetailsReader = new InputStreamReader(response.getEntity().getContent());
//create a buffer to fill if from reader
char[] buffer = new char[(int) response.getEntity().getContentLength()];
//fill the buffer by the help of reader
DetailsReader.read(buffer);
//close the reader streams
DetailsReader.close();
//String Temp2=null;
String Tempbuffer = new String(buffer);
JSONObject Details = new JSONObject(Tempbuffer); // —-Here I am getting Error—————
Comment by Srinivas — September 13, 2012 @ 10:05 am
Working for me! Thanks!
Comment by ariefspekta — June 15, 2013 @ 2:36 pm