[mono-android] recording video

Wally McClure theevilprogrammer at hotmail.com
Tue Jan 24 18:13:42 UTC 2012


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/b9454c9f/attachment.html>


More information about the Monodroid mailing list