我想构建一个应用程序,以便从平板电脑上的IP摄像头获取实时视频流。我搜索了很多,但我找不到任何实际的方法来做到这一点。 我找到了这段代码
[Activity(Label = "CameraTest1", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
{
int count = 1;
VideoView videoView;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
// Get our button from the layout resource,
// and attach an event to it
Button button = FindViewById<Button>(Resource.Id.MyButton);
videoView = FindViewById<VideoView>(Resource.Id.videoView1);
button.Click += button_Click;
}
void button_Click(object sender, EventArgs e)
{
videoView.SetVideoURI(Uri.Parse("rtsp://192.168.1.3/mjpeg"));
videoView.SetMediaController(new MediaController(this));
videoView.RequestFocus();
videoView.Start();
}
}
但它给了我一个错误(无法播放此视频) 任何帮助将不胜感激。