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. Problems with NotificationManager

Hi,
In my app I use several different notifications, which require
different actions. By default the notification manager loads the main
activity, when users select a notification. How can I change that so
different notifications prompt different actions. I've been studying
the related APIs, however, could not find a way of detecting which
notification a user has selected. Any thoughts?
Thanks.
--~--~---------~--~----~------------~-------~--~----~

2. Problems with ksoap2 and BasicAuth

hi,

at the moment i have the following problem. I try to establish a
connect to a SOAP-service. Therefore i need basicauth via http. I use
ksoap2 and HttpTransportBasicAuth.
The problem is, I do not know how i can start a call when i use
HttpTransportBasicAuth becouse the function "call" is not available.


     private static final String SOAP_ACTION = "getVessels";
     private static final String METHOD_NAME = "getVessels";
     private static final String NAMESPACE = "http://xxx.com/";
     private static final String URL = "http://xxx.com/soap/
android.wsdl";

     void test() {
         try {
                HttpTransportBasicAuth(URL,"foo","bar");

             HttpTransportSE androidHttpTransport = new HttpTransportSE
(URL);
             androidHttpTransport.debug = true;

          SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
             request.addProperty("query", "aida");

             SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
             envelope.setOutputSoapObject(request);

                androidHttpTransport.call(SOAP_ACTION, envelope);


             Object result = envelope.getResponse();

             //handle result here

             //myExampleHandler.getResults();
         } catch (Exception e) {
             e.printStackTrace();
         }
     }



i hope someone can help me.

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

3. NetCounter v0.6

4. How do I get Current GPS Location?

5. SOAP with ksoap2: BasicAuth-Problems

6. How to Show One tab at a time on the screen.

7. Android developer Needed urgently