Пример #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);
        }
Пример #2
0
		public Intent GetTakeVideoUI (StoreVideoOptions options)
		{
			if (!IsCameraAvailable)
				throw new NotSupportedException();

			VerifyOptions (options);

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

            VerifyOptions(options);

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

            VerifyOptions(options);

            return(TakeMediaAsync("video/*", MediaStore.ActionVideoCapture, options));
        }
Пример #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));
        }
Пример #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));
        }
Пример #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));
        }
Пример #8
0
		public Task<MediaFile> TakeVideoAsync (StoreVideoOptions options)
		{
			if (!VideosSupported)
				throw new NotSupportedException();
			if (!IsCameraAvailable)
				throw new NotSupportedException();
			
			VerifyCameraOptions (options);

			return GetMediaAsync (UIImagePickerControllerSourceType.Camera, TypeMovie, options);
		}
Пример #9
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);
		}
Пример #10
0
 public Task <MediaFile> TakeVideoAsync(StoreVideoOptions options)
 {
     throw new NotSupportedException();
 }
Пример #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);
		}
Пример #12
0
      public Task<MediaFile> TakeVideoAsync( StoreVideoOptions options )
      {
         if(!IsCameraAvailable)
         {
            throw new NotSupportedException();
         }

         VerifyOptions( options );

         return TakeMediaAsync( "video/*", MediaStore.ActionVideoCapture, options );
      }
Пример #13
0
 public Task <MediaFile> TakeVideoAsync(StoreVideoOptions param_options)
 {
     return(null);
 }
Пример #14
0
		public Task<MediaFile> TakeVideoAsync (StoreVideoOptions options)
		{
			throw new NotSupportedException();
		}