Reputation: 11198
I am working on integrating some video into one of my Activities. It plays fine, but I have to click play for it to actually play. I searched the forums and the developer site and cannot find anything relating to autoplay or autostart. Any suggestions?
package com.dop.mobilevforum;
import android.app.Activity;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
public class Vforum extends Activity
{
private String path = "http://somesite.com/video.mp4";
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.vforum);
VideoView mVideoView = (VideoView) findViewById(R.id.videoView);
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
}
}
Upvotes: 2
Views: 9792