Esempio n. 1
0
        private static MediaPickerController SetupController(MediaPickerDelegate mpDelegate, UIImagePickerControllerSourceType sourceType, string mediaType, StoreCameraMediaOptions options = null)
        {
            var picker = new MediaPickerController(mpDelegate);

            picker.MediaTypes = new[] { mediaType };
            picker.SourceType = sourceType;

            if (sourceType == UIImagePickerControllerSourceType.Camera)
            {
                picker.CameraDevice = GetUICameraDevice(options.DefaultCamera);

                if (mediaType == TypeImage)
                {
                    picker.CameraCaptureMode = UIImagePickerControllerCameraCaptureMode.Photo;
                }
                else if (mediaType == TypeMovie)
                {
                    StoreVideoOptions voptions = (StoreVideoOptions)options;

                    picker.CameraCaptureMode    = UIImagePickerControllerCameraCaptureMode.Video;
                    picker.VideoQuality         = GetQuailty(voptions.Quality);
                    picker.VideoMaximumDuration = voptions.DesiredLength.TotalSeconds;
                }
            }

            return(picker);
        }
		public Intent GetTakeVideoUI (StoreVideoOptions options)
		{
			if (!IsCameraAvailable)
				throw new NotSupportedException();

			VerifyOptions (options);

			return CreateMediaIntent (GetRequestId(), "video/*", MediaStore.ActionVideoCapture, options, tasked: false);
		}
Esempio n. 3
0
        public Intent GetTakeVideoUI(StoreVideoOptions options)
        {
            if (!IsCameraAvailable)
            {
                throw new NotSupportedException();
            }

            VerifyOptions(options);

            return(CreateMediaIntent(GetRequestId(), "video/*", MediaStore.ActionVideoCapture, options, tasked: false));
        }
Esempio n. 4
0
        public Task <MediaFile> TakeVideoAsync(StoreVideoOptions options)
        {
            if (!IsCameraAvailable)
            {
                throw new NotSupportedException();
            }

            VerifyOptions(options);

            return(TakeMediaAsync("video/*", MediaStore.ActionVideoCapture, options));
        }
Esempio n. 5
0
        public Task <MediaFile> TakeVideoAsync(StoreVideoOptions options)
        {
            if (!VideosSupported)
            {
                throw new NotSupportedException();
            }
            if (!IsCameraAvailable)
            {
                throw new NotSupportedException();
            }

            VerifyCameraOptions(options);

            return(TakeMedia(UIImagePickerControllerSourceType.Camera, TypeMovie, options));
        }
Esempio n. 6
0
        public MediaPickerController GetTakeVideoUI(StoreVideoOptions options)
        {
            if (!VideosSupported)
            {
                throw new NotSupportedException();
            }
            if (!IsCameraAvailable)
            {
                throw new NotSupportedException();
            }

            VerifyCameraOptions(options);

            var d = new MediaPickerDelegate(null, UIImagePickerControllerSourceType.Camera, options);

            return(SetupController(d, UIImagePickerControllerSourceType.Camera, TypeMovie, options));
        }
Esempio n. 7
0
        public async Task <MediaFile> TakeVideoAsync(StoreVideoOptions options)
        {
            options.VerifyOptions();

            var capture = new CameraCaptureUI();

            capture.VideoSettings.MaxResolution        = GetResolutionFromQuality(options.Quality);
            capture.VideoSettings.MaxDurationInSeconds = (float)options.DesiredLength.TotalSeconds;
            capture.VideoSettings.Format = CameraCaptureUIVideoFormat.Mp4;

            var result = await capture.CaptureFileAsync(CameraCaptureUIMode.Video).AsTask(false);

            if (result == null)
            {
                throw new TaskCanceledException();
            }

            return(new MediaFile(result.Path, () => result.OpenStreamForReadAsync().Result));
        }
		public Task<MediaFile> TakeVideoAsync (StoreVideoOptions options)
		{
			if (!VideosSupported)
				throw new NotSupportedException();
			if (!IsCameraAvailable)
				throw new NotSupportedException();
			
			VerifyCameraOptions (options);

			return GetMediaAsync (UIImagePickerControllerSourceType.Camera, TypeMovie, options);
		}
		public MediaPickerController GetTakeVideoUI (StoreVideoOptions options)
		{
			if (!VideosSupported)
				throw new NotSupportedException();
			if (!IsCameraAvailable)
				throw new NotSupportedException();
			
			VerifyCameraOptions (options);

			var d = new MediaPickerDelegate (null, UIImagePickerControllerSourceType.Camera, options);
			return SetupController (d, UIImagePickerControllerSourceType.Camera, TypeMovie, options);
		}
Esempio n. 10
0
 public Task <MediaFile> TakeVideoAsync(StoreVideoOptions options)
 {
     throw new NotSupportedException();
 }
Esempio n. 11
0
		public async Task<MediaFile> TakeVideoAsync (StoreVideoOptions options)
		{
			options.VerifyOptions();

			var capture = new CameraCaptureUI();
			capture.VideoSettings.MaxResolution = GetResolutionFromQuality (options.Quality);
			capture.VideoSettings.MaxDurationInSeconds = (float)options.DesiredLength.TotalSeconds;
			capture.VideoSettings.Format = CameraCaptureUIVideoFormat.Mp4;

			var result = await capture.CaptureFileAsync (CameraCaptureUIMode.Video).AsTask (false);
			if (result == null)
				throw new TaskCanceledException();

			return new MediaFile (result.Path, () => result.OpenStreamForReadAsync().Result);
		}
Esempio n. 12
0
      public Task<MediaFile> TakeVideoAsync( StoreVideoOptions options )
      {
         if(!IsCameraAvailable)
         {
            throw new NotSupportedException();
         }

         VerifyOptions( options );

         return TakeMediaAsync( "video/*", MediaStore.ActionVideoCapture, options );
      }
Esempio n. 13
0
 public Task <MediaFile> TakeVideoAsync(StoreVideoOptions param_options)
 {
     return(null);
 }
Esempio n. 14
0
		public Task<MediaFile> TakeVideoAsync (StoreVideoOptions options)
		{
			throw new NotSupportedException();
		}