Hi,
This is how I am doing -
// Create a new media player and set the listeners
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setDataSource(path);
mMediaPlayer.setDisplay(holder);
//mMediaPlayer.prepare();
mMediaPlayer.prepareAsync();
mMediaPlayer.setOnBufferingUpdateListener(this);
//mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);
public void onPrepared(MediaPlayer mediaplayer) {
Log.d(TAG, "onPrepared called");
mVideoWidth = mMediaPlayer.getVideoWidth();
mVideoHeight = mMediaPlayer.getVideoHeight();
if (mVideoWidth != 0 && mVideoHeight != 0) {
holder.setFixedSize(mVideoWidth, mVideoHeight);
mMediaPlayer.setScreenOnWhilePlaying(true);
mMediaPlayer.start();
}
}
On Mar 2, 6:07 pm, Rob Franz <[email protected]> wrote:
> how are you setting up the media player? i.e. what's your series of calls?
>
> On Mon, Mar 2, 2009 at 6:49 AM, manoj <[email protected]> wrote:
>
> > Hi,
>
> > I want to play .m4v file which is on some server .
>
> > When I am trying to play the file, I am getting error,
> > E/MediaPlayer( 2092): Error (-1,0)
>
> > and nothing is happening.
>
> > Can any one please help me how to solve this problem.
>
> > Thanks,
> > Manoj.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---