[mono-android] recording video

Wally McClure theevilprogrammer at hotmail.com
Tue Jan 24 18:34:36 UTC 2012


To followup on this, I went back to mfa 4.0.1 and got the same result.

Wally

From: theevilprogrammer at hotmail.com
To: monodroid at lists.ximian.com
Subject: recording video
Date: Tue, 24 Jan 2012 13:13:42 -0500







I'm trying to record some video on my local phone.  I've got the code below in my on activity result.  Unfortunately, my Intent data object is coming back with all of its properties as null or zero.  I'm currently running in 4.0.3 beta mfa.  Is there anything here that looks blatantly incorrect?

Wally

            Intent intent = new Intent(Android.Provider.MediaStore.ActionVideoCapture);
            Java.IO.File f = new Java.IO.File(Android.OS.Environment.ExternalStorageDirectory, "appname_tmp_vid.3gp");
            var mCameraUri = Android.Net.Uri.FromFile(f);
            intent.PutExtra(Android.Provider.MediaStore.ExtraOutput, mCameraUri);
            intent.PutExtra(Android.Provider.MediaStore.ExtraVideoQuality, 1); // set the video image quality to high
 
            StartActivityForResult(intent, TAKE_VID);
       
 protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            if (requestCode == TAKE_VID)
            {
                if ((data != null) && (data.Data != null))
                {
                    Android.Net.Uri recordedVideo = data.Data;
                    Toast.MakeText(this, String.Format("Video Saved To: {0}.", recordedVideo.Path), ToastLength.Long).Show();
                    

 		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodroid/attachments/20120124/2594ea74/attachment.html>


More information about the Monodroid mailing list