Hello,
new to all of this. using Android 2.1 in Eclipse, all i want to do for
now is to get the video working in an Emulator via "videoview" ..
little help would be vmuch apperciated.
cheers..
package info.shouraig.com;
import android.app.Activity;
import android.content.res.AssetFileDescriptor;
import android.media.MediaPlayer.OnCompletionListener;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
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
XSO4 = new VideoView(null);
VideoView. 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((OnCompletionListener) this);
video.start();
}
}
--
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