Sunday, 8 September 2013

Live stream from an IP Camera to Android with Mono For Android

Live stream from an IP Camera to Android with Mono For Android

I want to build an application with MONO FOR ANDROID to get live video
stream from an IP camera on my Tablet. I have googled a lot but I couldn't
find any practical way of doing this. I have found this code
[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();
}
}
but it gives me an error (Can't play this video) Any help will be
appreciated.

No comments:

Post a Comment