Media player Problem-The application videoplayer has stopped unexpectedly please try again.

by Dagger » Sun, 02 Nov 2008 23:45:56 GMT


Sponsored Links
  am using the 0.9 version of android SDK
Encountering the error The application videoplayer has stopped
unexpectedly please try again.
This is the code which I have
Videoplayer.java

package com.android.VideoPlayer;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

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;

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.addCallback(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) {



Media player Problem-The application videoplayer has stopped unexpectedly please try again.

by Dagger » Sun, 02 Nov 2008 23:53:50 GMT


 ey developers I need help with this problem

On Nov 2, 8:45pm, Dagger <[EMAIL PROTECTED]> wrote:
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Media player Problem-The application videoplayer has stopped unexpectedly please try again.

by Dagger » Mon, 03 Nov 2008 00:32:28 GMT


 omeone reply please

On Nov 2, 9:04pm, "Kipling Inscore" <[EMAIL PROTECTED]> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Anyone else got a post-Cupcake upgrade on their UK G1

Yes, I had it waiting for me this morning. Perhaps it was a critical
security patch. Rumours that the US OTA rollout were delayed might be
related.
Tom

2009/5/22 Al Sutton <a...@funkyandroid.com>


--~--~---------~--~----~------------~-------~--~----~

2. Desktop synchronization of Android just like WM-phones

Hi friends,

Let me put these questions as simple as it can be -

1. is it possible for android to synchronize with the desktop computer
running Win XP?, if yes how? Wm phones can do it seamlessly using
MSActivesync.

2. is it possible to use the desktop's internet connection and browse
the web from the android? (just like WM-phones do with MS Activesync)

3. Is there a way to import all the Windows mobile contacts onto the
Android phone? NOT from google mail-account because I have different
contacts in my phone and gmail. And I would like to import my Phone
contacts onto Android.

THANKS to anyone who answers all/part of the queries.

Shujon

--~--~---------~--~----~------------~-------~--~----~

3. Android source 1.0

4. why 480*320 png doesn't fit on landscape full screen

5. Free download software full version

6. URLEncoder encode/decode

7. I found the way how to SmsReceiver invoke my Application