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. Android File System Build Error

Hi,

I started to work with the latest Android version for OMAP3430 (Zoom1)
platform by getting sources via "repo sync". The u-boot and kernel
images were built successfully but file system build encountered the
issue for vendor/ti/ldp1/buildspec.mk.default configuration (copied to
buildspec.mk)

make: *** No rule to make target `out/target/product/ldp1/obj/lib/
libopencore_player.so', needed by `out/target/product/ldp1/obj/
SHARED_LIBRARIES/libmediaplayerservice_intermediates/LINKED/
libmediaplayerservice.so'.  Stop.

Could you advise which Android version to use and how to get it via
repo?

Igal

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

2. Video resolution support

Hello All,

What are the video resolutions supported by the PV codecs in the
opencore module? Is there a manual or guide describing this?


Warm Regards,
Raghu

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

3. How to extract an image from a video

4. how to add scroll bar to linearlayout

5. Generating Touch screen events from remote host PC

6. Android 1.5 Cupcake

7. So when will we be allowed to Force Quit any process we want without root access?