little help, please...

simply would like to insert video into the "VideoView" widget,  using
mp4 located on my local HD. I am stuck in what should be fairly
straight forward. (according to the developers page)  never written
any code before now., jumpin in at the D.E.  at this for  3 straight
days.. and still not sure. im Using Java Ecllipse and Android 2.1
API.

appreciate all help to put me on the right path.

cheers


package info.shouraig.com;

import android.app.Activity;
import android.content.res.AssetFileDescriptor;
import android.os.Bundle;
import android.widget.VideoView;

public class XSO4 extends Activity {
        VideoView XSO4;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        AssetFileDescriptor afd = getResources().openRawResourceFd
(R.raw.XSCycling.mp4);

        // Create a new media player and set the listeners
        MediaPlayer = new MediaPlayer();

        mMediaPlayer.setDataSource(afd.getFileDescriptor(),
afd.getStartOffset(), afd.getLength());

VideoView video = (VideoView) this.findViewById(R.id.VideoXSO4);



Uri uri = Uri.parse("android.resource://info.shouraig.com/" +
R.raw.XSCycling.mp4);
video.setVideoURI(uri);
video.setMediaController(new MediaController(this));
video.requestFocus();
video.setOnCompletionListener(this);
video.start();


    }
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to