VideoView Not Playing, Error(1,-1)
- by Jesse J
I originally thought that the video format was wrong, but after trying .mov, .3gp, and .mp4 with H.264, I'm wondering if something is wrong with my code?
public class IntroActivity extends Activity
{
VideoView videoHolder;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
}
@Override
protected void onStart()
{
getWindow().setFormat(PixelFormat.TRANSLUCENT);
videoHolder = new VideoView(this);
//videoHolder = (VideoView)findViewById(R.id.myvideoview);
Uri video = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.menu);
videoHolder.setVideoURI(video);
videoHolder.start();
videoHolder.setOnCompletionListener(new MediaPlayer.OnCompletionListener()
{
public void onCompletion(MediaPlayer mp)
{
videoHolder.start();
}
});
setContentView(videoHolder);
super.onStart();
}