Coder Social home page Coder Social logo

mediaplugin's Introduction

Update Novemeber 2020

Xamarin.Essentials 1.6 introduced official support for picking/taking photos and videos with the new Media Picker API.

This library has a lot of legacy code that is extremely hard to maintain and update to support the latest OSes without a major re-write. I will officially be archiving this library in December 2020 unless anyone from the community wants to adopt the project.

Media Plugin for Xamarin and Windows

Simple cross platform plugin to take photos and video or pick them from a gallery from shared code.

Please read through all of the setup directions below: https://github.com/jamesmontemagno/MediaPlugin#important-permission-information

Ported from Xamarin.Mobile to a cross platform API.

Setup

Build Status:

Platform Support

Platform Version
Xamarin.iOS iOS 7+
Xamarin.Android API 14+
Windows 10 UWP 10+
.NET for iOS iOS 10+
.NET for Android API 21+
Windows App SDK (WinUI3) 10+
.NET for Mac Catalyst All
Tizen 4+

API Usage

Call CrossMedia.Current from any project or PCL to gain access to APIs.

Before taking photos or videos you should check to see if a camera exists and if photos and videos are supported on the device. There are five properties that you can check:

/// <summary>
/// Initialize all camera components, must be called before checking properties below
/// </summary>
/// <returns>If success</returns>
Task<bool> Initialize();

/// <summary>
/// Gets if a camera is available on the device
/// </summary>
bool IsCameraAvailable { get; }

/// <summary>
/// Gets if ability to take photos supported on the device
/// </summary>
bool IsTakePhotoSupported { get; }

/// <summary>
/// Gets if the ability to pick photo is supported on the device
/// </summary>
bool IsPickPhotoSupported { get; }

/// <summary>
/// Gets if ability to take video is supported on the device
/// </summary>
bool IsTakeVideoSupported { get; }

/// <summary>
/// Gets if the ability to pick a video is supported on the device
/// </summary>
bool IsPickVideoSupported { get; }

Photos

/// <summary>
/// Picks a photo from the default gallery
/// </summary>
/// <param name="options">Pick Photo Media Options</param>
/// <returns>Media file or null if canceled</returns>
Task<MediaFile> PickPhotoAsync(PickMediaOptions options = null);

/// <summary>
/// Take a photo async with specified options
/// </summary>
/// <param name="options">Camera Media Options</param>
/// <returns>Media file of photo or null if canceled</returns>
Task<MediaFile> TakePhotoAsync(StoreCameraMediaOptions options);

Videos

/// <summary>
/// Picks a video from the default gallery
/// </summary>
/// <returns>Media file of video or null if canceled</returns>
Task<MediaFile> PickVideoAsync();

/// <summary>
/// Take a video with specified options
/// </summary>
/// <param name="options">Video Media Options</param>
/// <returns>Media file of new video or null if canceled</returns>
Task<MediaFile> TakeVideoAsync(StoreVideoOptions options);

Usage

Via a Xamarin.Forms project with a Button and Image to take a photo:

takePhoto.Clicked += async (sender, args) =>
{
    await CrossMedia.Current.Initialize();
    
    if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
    {
        DisplayAlert("No Camera", ":( No camera available.", "OK");
        return;
    }

    var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
    {
        Directory = "Sample",
        Name = "test.jpg"
    });

    if (file == null)
        return;

    await DisplayAlert("File Location", file.Path, "OK");

    image.Source = ImageSource.FromStream(() =>
    {
        var stream = file.GetStream();
        return stream;
    }); 
};

To see more examples of usage without Xamarin.Forms open up the test folder in this project.

Directories and File Names

Setting these properties are optional. Any illegal characters will be removed and if the name of the file is a duplicate then a number will be appended to the end. The default implementation is to specify a unique time code to each value.

Photo & Video Settings

Compressing Photos

When calling TakePhotoAsync or PickPhotoAsync you can specify multiple options to reduce the size and quality of the photo that is taken or picked. These are applied to the StoreCameraMediaOptions and PickMediaOptions.

Resize Photo Size

By default the photo that is taken/picked is the maxiumum size and quality available. For most applications this is not needed and can be Resized. This can be accomplished by adjusting the PhotoSize property on the options. The easiest is to adjust it to Small, Medium, or Large, which is 25%, 50%, or 75% or the original. This is only supported in Android & iOS. On UWP there is a different scale that is used based on these numbers to the respected resolutions UWP supports.

var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
{
    PhotoSize = PhotoSize.Medium,
});

Or you can set to a custom percentage:

var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
{
    PhotoSize = PhotoSize.Custom,
    CustomPhotoSize = 90 //Resize to 90% of original
});

Photo Quality

Set the CompressionQuality, which is a value from 0 the most compressed all the way to 100, which is no compression. A good setting from testing is around 92. This is only supported in Android & iOS

var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
{
    CompressionQuality = 92
});

Saving Photo/Video to Camera Roll/Gallery

You can now save a photo or video to the camera roll/gallery. When creating the StoreCameraMediaOptions or StoreVideoMediaOptions simply set SaveToAlbum to true. When your user takes a photo it will still store temporary data, but also if needed make a copy to the public gallery (based on platform). In the MediaFile you will now see a AlbumPath that you can query as well.

var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
{
    SaveToAlbum = true
});

//Get the public album path
var aPpath = file.AlbumPath; 

//Get private path
var path = file.Path;

This will restult in 2 photos being saved for the photo. One in your private folder and one in a public directory that is shown. The value will be returned at AlbumPath.

Android: When you set SaveToAlbum this will make it so your photos are public in the Pictures/YourDirectory or Movies/YourDirectory. This is the only way Android can detect the photos.

Allow Cropping

Both iOS and UWP have crop controls built into the the camera control when taking a photo. On iOS the default is false and UWP the default is true. You can adjust the AllowCropping property when taking a photo to allow your user to crop.

var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
{
    AllowCropping = true
});

Default Camera

By default when you take a photo or video the default system camera will be selected. Simply set the DefaultCamera on StoreCameraMediaOptions. This option does not guarantee that the actual camera will be selected because each platform is different. It seems to work extremely well on iOS, but not so much on Android. Your mileage may vary.

var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
{
    DefaultCamera = Plugin.Media.Abstractions.CameraDevice.Front
});

Take Photo Overlay (iOS Only)

On iOS you are able to specify an overlay on top of the camera. It will show up on the live camera and on the final preview, but it is not saved as part of the photo, which means it is not a filter.

//Load an image as an overlay (this is in the iOS Project)
Func<object> func = () =>
{
    var imageView = new UIImageView(UIImage.FromBundle("face-template.png"));
    imageView.ContentMode = UIViewContentMode.ScaleAspectFit;

    var screen = UIScreen.MainScreen.Bounds;
    imageView.Frame = screen;

    return imageView;
};

//Take Photo, could be in iOS Project, or in shared code where there function is passed up via Dependency Services.
var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions
{
    OverlayViewProvider = func
});

Important Permission Information

Please read these as they must be implemented for all platforms.

Android

The WRITE_EXTERNAL_STORAGE & READ_EXTERNAL_STORAGE permissions are required, but the library will automatically add this for you. Additionally, if your users are running Marshmallow the Plugin will automatically prompt them for runtime permissions. You must add Xamarin.Essentials.Platform.OnRequestPermissionsResult code into your Main or Base Activities:

Add to Activity:

public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
{
    Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
    base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}

Android Required Setup

This plugin uses the Xamarin.Essentials, please follow the setup guide: http://aka.ms/essentials-getstarted

Android File Provider Setup

You must also add a few additional configuration files to adhere to the new strict mode:

1a.) (Non AndroidX) Add the following to your AndroidManifest.xml inside the <application> tags:

<provider android:name="android.support.v4.content.FileProvider" 
          android:authorities="${applicationId}.fileprovider" 
          android:exported="false" 
          android:grantUriPermissions="true">
          
	  <meta-data android:name="android.support.FILE_PROVIDER_PATHS" 
                     android:resource="@xml/file_paths"></meta-data>
</provider>

Note: If you receive the following error, it is because you are using AndroidX. To resolve this error, follow the instructions in Step 1b.).

Unable to get provider android.support.v4.content.FileProvider: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.FileProvider" on path: DexPathList

1b.) (AndroidX) Add the following to your AndroidManifest.xml inside the <application> tags:

<provider android:name="androidx.core.content.FileProvider" 
          android:authorities="${applicationId}.fileprovider" 
          android:exported="false" 
          android:grantUriPermissions="true">
          
	  <meta-data android:name="android.support.FILE_PROVIDER_PATHS" 
                     android:resource="@xml/file_paths"></meta-data>
</provider>

2.) Add a new folder called xml into your Resources folder and add a new XML file called file_paths.xml. Make sure that this XML file has a Build Action of: AndroidResource.

Add the following code:

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <external-files-path name="my_images" path="Pictures" />
    <external-files-path name="my_movies" path="Movies" />
</paths>

You can read more at: https://developer.android.com/training/camera/photobasics.html

Android Optional Setup

By default, the library adds android.hardware.camera and android.hardware.camera.autofocus to your apps manifest as optional features. It is your responsbility to check whether your device supports the hardware before using it. If instead you'd like Google Play to filter out devices without the required hardware, add the following to your AssemblyInfo.cs file in your Android project:

[assembly: UsesFeature("android.hardware.camera", Required = true)]
[assembly: UsesFeature("android.hardware.camera.autofocus", Required = true)]

iOS

Your app is required to have keys in your Info.plist for NSCameraUsageDescription and NSPhotoLibraryUsageDescription in order to access the device's camera and photo/video library. If you are using the Video capabilities of the library then you must also add NSMicrophoneUsageDescription. If you want to "SaveToGallery" then you must add the NSPhotoLibraryAddUsageDescription key into your info.plist. The string that you provide for each of these keys will be displayed to the user when they are prompted to provide permission to access these device features. You can read me here: New iOS 10 Privacy Permission Settings

Such as:

<key>NSCameraUsageDescription</key>
<string>This app needs access to the camera to take photos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photos.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to microphone.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app needs access to the photo gallery.</string>

If you want the dialogs to be translated you must support the specific languages in your app. Read the iOS Localization Guide

UWP

Set Webcam permission.

Permission Recommendations

By default, the Media Plugin will attempt to request multiple permissions, but each platform handles this a bit differently, such as iOS which will only pop up permissions once.

You can use Xamarin.Essentials to request and check permissions manually.

FAQ

Here are some common answers to questions:

On iOS how do I translate the text on the buttons on the camera?

You need CFBundleLocalizations in your Info.plist.

License

Licensed under MIT, see license file. This is a derivative to Xamarin.Mobile's Media with a cross platform API and other enhancements.

//
//  Copyright 2011-2013, Xamarin Inc.
//
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//
//        http://www.apache.org/licenses/LICENSE-2.0
//
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.
//

Want To Support This Project?

All I have ever asked is to be active by submitting bugs, features, and sending those pull requests down! Want to go further? Make sure to subscribe to my weekly development podcast Merge Conflict, where I talk all about awesome Xamarin goodies and you can optionally support the show by becoming a supporter on Patreon.

mediaplugin's People

Contributors

azureadvocatebit avatar bijington avatar bpater-tp avatar breyed avatar brminnick avatar bruzkovsky avatar gaelian avatar garie avatar gbeaulieu avatar ideallee avatar ilber avatar ingweland avatar jamesmontemagno avatar jtillyt avatar kirrek avatar knxrb avatar lucecarter avatar manbirsinghrakhra avatar marc-77777777 avatar marcojak avatar nicolascaorsi avatar nxsoftware avatar prashantvc avatar redth avatar samirbittar avatar softsan avatar tacoman667 avatar timheuer avatar vagrawal1986 avatar vatsalyagoel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mediaplugin's Issues

TakePhotoAsync take several minutes to go back to code

When I call the function TakePhotoAsync(...) it takes several minutes there and image shows with delay on page.

If the image size is too big, it takes more time. Is there any way to tell the image size I want the photo store?

` StoreCameraMediaOptions cameraOptions = new Plugin.Media.Abstractions.StoreCameraMediaOptions
{

                    Directory = "VesselsPhotos",
                    Name = namePhotoVessel + ".jpg",
                    DefaultCamera = CameraDevice.Rear,
                    PhotoSize = PhotoSize.Small,
                };
                file = await CrossMedia.Current.TakePhotoAsync(cameraOptions);`

Thank you!

Xam.Media - very long time for photo to load (in portrait orientation only)

From @100s on March 23, 2016 12:49

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • [x ] Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • [x ] Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.4.0 - Beta3
Device Tested On: Samsung Galaxy S5, Samsung Galaxy Note 10
Simulator Tested On:

Expected Behavior

Photo taken in portrait orientation should load almost immediately.

Actual Behavior

Photo taken in portrait orientation loads about 5-15 seconds. For photo in panorama orientation it loads immediately. It works correctly in version 2.3.0.

Steps to reproduce the Behavior

Take a photo in landscape mode
Wait for the result

Copied from original issue: jamesmontemagno/Xamarin.Plugins#258

Status bar text changes color on iOS when picking photo

From @steckums on February 25, 2016 21:15

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.3.0
Device Tested On: iPad
Simulator Tested On: n/a

Expected Behavior

Status bar text stays the same initially set by the app.

Actual Behavior

Status bar changes to black text when picking a picture.

Steps to reproduce the Behavior

Set the status bar text to white.
Have a buttons select a photo.
Select "Camera Roll"
The status bar text is now black.

Copied from original issue: jamesmontemagno/Xamarin.Plugins#230

Frozen screen when taking picture from iPhone

Hi.

After take a picture from my iPhone camera, the screen is frozen, and it does not return to the app.
However, if I pick a picture, it does not do anything when I select a picture.

I am using Xamarin 2.3.

What can be happening? In Android and iPad works fine.

(await ...PickPhotoAsync()).GetStream().Length is 3x bigger on iOS

Bug

Version Number of Plugin:2.3.0
Device Tested On: HTC One - Android 5.0, iPhone 6

Expected Behavior

MediaFile.GetStream().Length should be almost the same as the actual image size in bytes

Actual Behavior

MediaFile.GetStream().Length is 2-3 times bigger than the actual image size in bytes. That's only on iOS. On Android - it's OK.
For image size of 60-70KB the MediaFile.GetStream().Length is almost 200KB.

Steps to reproduce the Behavior

I'm using it in PCL:
var photo = await CrossMedia.Current.PickPhotoAsync()

Pick or take photo produces black/empty preview on iOS/Android

From @BakDavide on March 24, 2016 10:7

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.3.0
Device Tested On: iPhone 6S, iPad 2, LG G3 (Android 6)
Simulator Tested On:iPhone 6

Expected Behavior

After selecting an image from the gallery or take new from camera I view a preview of the selected image (using ImageSource.FromFile(mediaFile.Path))

Actual Behavior

On iOS after selecting an image from the gallery displays a black preview of the selected image (using ImageSource.FromFile(mediaFile.Path)).
On Android after take picture from camera displays an empty preview of the image (using ImageSource.FromFile(mediaFile.Path)).

Steps to reproduce the Behavior

With iOS select an image from gallery and use an ImageSource to show the selected image (black preview).
With Androd take a photo from camera and use an ImageSource to show the selected image (empty preview).
The gallery problem is reproduced only on iOS while the camera problem is reproduced only on Android 6 (with my LG G3 with Android 5 the problem does not occur).

Copied from original issue: jamesmontemagno/Xamarin.Plugins#260

Empty file is created on canceling, while take photo with SaveToAlbum = true

From @CarMatt on June 17, 2016 13:22

This is a

  • Bug

Which plugin does this impact:

  • Media

Bug

Version Number of Plugin: 2.3.0
Device Tested On:
Samsung S4 Droid 5.0.1
Samsung S6 Droid 6.0.1
Simulator Tested On:
Visual Studio emulator Droid 5.1.1

Expected Behavior

No file should be created when you canceling a photo

Actual Behavior

When you take a photo and you choose to cancel, an empty file is created on disk

Steps to reproduce the Behavior

Select cancel when to take a photo

Copied from original issue: jamesmontemagno/Xamarin.Plugins#335

Can't access PhotoSize or CompressionQuality of StoreCameraMediaOptions

Version Number of Plugin: 2.3.0
Device Tested On: Android; Windows Visual Studio 15

Expected Behavior

var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions { DefaultCamera = CameraDevice.Rear, Directory = "Test", Name = "Original.jpg", PhotoSize = PhotoSize.Full, SaveToAlbum = false });

Actual Behavior

'StoreCameraMediaOptions' does not contain a definition for 'PhotoSize'

Skip the preview screen upon taking a picture

Hey there

I'm wondering if there's a way to skip the preview once the a picture is taken.
What i'm trying to accomplish once the picture is taken return to the original screen without prompting the user to "Save" or "Cancel" the picture.

Thanks much in advance

42

Version Number of Plugin:
Device Tested On: Samsung API and Asus API 21
Simulator Tested On:

Expected Behavior

Actual Behavior

Steps to reproduce the Behavior

Feature Request:

Please fill in what you would like

[Feature Request] Option to return Picked Media's original Album Path

From @Jazzeroki on December 18, 2015 7:6

Just tested so far with Android but the Path extension is returning a path inside of a temp directory. If I use AlbumPath when taking a photo that is working great. My trouble currently is when I pick a photo that photo path isn't usable to pass to another application like say an image cropper or exif reader. Album path parameter be changed to also work when picking a photo not just saving one. Might also be good to do with video I just haven't needed that yet.

Copied from original issue: jamesmontemagno/Xamarin.Plugins#164

PickPhotoAsync problem on Android 5.1.1

From @apivovar on March 3, 2016 11:35

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.3.0, 2.4.0-beta2
Device Tested On: Android 5.1.1 (Nexus 4)
Simulator Tested On:

Expected Behavior

It should show Gallery image picker at least.
However it does nothing, because of the exception caught in MediaPickerActivity.cs file:

No Activity found to handle Intent act=android.intent.action.PICK typ=image

Looks like this issue is reproduced since Android Lollipop.

Actual Behavior

await CrossMedia.Current.PickPhotoAsync() returns null

How to fix

Please, replace Intent.ActionPick with Intent.ActionGetContent all over the code of the plugin (MediaImplementation.cs and MediaPickerActivity.cs files).
ACTION_GET_CONTENT provides more useful user interface.

Copied from original issue: jamesmontemagno/Xamarin.Plugins#240

Xam.Plugin.Media taking photo not working on Xamarin.Forms(currently 2.2.0.31)

From @huby01 on May 12, 2016 14:32

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • Bug

Which plugin does this impact:

  • Media

Version Number of Plugin:2.3.0
Device Tested On:
Simulator Tested On:WP8.1

Expected Behavior

Taking photo

Actual Behavior

Taking photo task hangs with an endless "Resume..." message

Steps to reproduce the Behavior

Copied from original issue: jamesmontemagno/Xamarin.Plugins#303

Media Plugin throws exception on TakePhotoAsync

From @dodyg on April 20, 2016 12:19

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • [x ] Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • [ x] Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.3.0
Device Tested On:
Simulator Tested On: Xamarin Android Player

Expected Behavior

File saved to directory

Actual Behavior

System.IO.IOException: Win32 IO returned 25, path:/storage/emulated/0/Pictures/2016 12:18:01 pm.jpg

Steps to reproduce the Behavior

 if (CrossMedia.Current.IsCameraAvailable && CrossMedia.Current.IsTakePhotoSupported)
                {
                    // Supply media options for saving our photo after it's taken.
                    var mediaOptions = new Plugin.Media.Abstractions.StoreCameraMediaOptions
                    {
                        SaveToAlbum = true,
                        Name = $"{DateTime.UtcNow}.jpg"
                    };

                    // Take a photo of the business receipt.
                    var photo = await CrossMedia.Current.TakePhotoAsync(mediaOptions);
}

Copied from original issue: jamesmontemagno/Xamarin.Plugins#288

Image is flipped horizontally when using front facing camera

Please fill out either the bug or feature request section and remove whatever section you are not using.

Bug

Version Number of Plugin: 2.3.0
Device Tested On: iPhone 6s Plus, Moto E
Simulator Tested On: x86 Android

Expected Behavior

I'm using the sample application - when I click "take photo" then switch to the front facing camera and click the camera button, the image returned should look identical to the preview.

Actual Behavior

I'm using the sample application - when I click "take photo" then switch to the front facing camera and click the camera button, the image returned is flipped on it's horizontal axis.

Steps to reproduce the Behavior

Launch the sample application, switch to the front facing (selfie) camera, and take a photo. The returned image will be incorrectly flipped horizontally.

Broken camera image rotation on WP8.1 for Lumia 930

Bug

Version Number of Plugin: 2.5.1.0 (have experienced the same issue on 2.3 as well)
Device Tested On: Nokia Lumia 930 (Windows Phone 8.10.14234.375)
Simulator Tested On: N/A

Expected Behavior

The camera image should be properly rotated no matter the device orientation when using TakePhotoAsync.

Actual Behavior

On the specific device the WinPhoneRT version of the media plugins rotates the image 90 degrees counter clockwise when in portrait mode. If tilting the device 90 degrees to the left, placing it in landscape mode the camera image rotation is correct. But if tilting it to the right the image is upside down. In other words: the camera image does not readjust according to the device orientation.

Please refer to these images:
Portrait
Normal landscape
Flipped landscape

Steps to reproduce the Behavior

Build and run a basic Windows Phone 8.1 RT app running the default code example from the plugin home page (the code below "Usage"). Or download this example project: https://1drv.ms/u/s!ArvY_GnQCZJ_hKYoSmuvJUfsxIy8Fg

I've only been able to test the application using the Lumia 930. So I don't know if it's working on other WP8.1 devices. On Android I've never experienced this issue though.

Media plugin bug on Android when pressing home and reentering application which calls TakePhotoAsync() again

From @igorczapski on January 4, 2016 14:44

Steps to reproduce:

  1. After Activity initialization call:
    var photo = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions{
    Directory = SOME_DIRECTORY,
    Name = SOME_NAME
    });
  2. When you have photo app opened, press HOME button on device.
  3. Reenter the app, go to your activity which calls method above.
  4. InvalidOperationException -> Only one operation can be active at a time.

It doesn't matter if it's Xamarin.Forms or Xamarin.Android, obviously.

Workaround:
In Xamarin.Android just use the standard way with intents and OnActivityResult, or at least you can make some use of intent creation method, from this library.

var media = new MediaImplementation();
var intent = media.GetTakePhotoUI (new Abstractions.StoreCameraMediaOptions {
Directory = DIRECTORY,
Name = NAME
});
StartActivityForResult (intent, ...);

Copied from original issue: jamesmontemagno/Xamarin.Plugins#174

[Media] Windows Phone RT 8.1 - Bug in the TakePhotoAsync() method

From @avorobjovs on June 3, 2016 13:52

Please take a moment to fill out the following (change to preview to check or place x in []) and remove all unused areas

This is a

  • Bug
  • [] Feature Request

Which plugin does this impact:

  • [] Battery
  • [] Connectivity
  • [] Contacts
  • [] DeviceInfo
  • [] ExternalMaps
  • [] Geolocator
  • Media
  • [] Permissions
  • [] Settings
  • [] Text To Speech
  • [] Vibrate
  • Other:

Bug

Version Number of Plugin: 2.3.0
Device Tested On: Nokia Lumia 830, Windows Phone 8.1 Update 2, OS version 8.10.15148.160
Simulator Tested On:

Expected Behavior

The TakePhotoAsync() method returns MediaFile object.

Actual Behavior

The TakePhotoAsync() method raises an exception.

Steps to reproduce the Behavior

  1. Create new Windows Phone RT 8.1 application.
  2. Add a button to the MainPage.xaml
  3. Add an event handler method for the button to the MainPage.xaml.cs code-behaviour file,
  4. In the event handler method call the CrossMedia.Current.Initialize() method, then call the CrossMedia.Current.TakePhotoAsync() method.
  5. The "Windows.UI.Xaml.Markup.XamlParseException: XAML parsing failed." exception is thrown.

Full exception stack trace:

Windows.UI.Xaml.Markup.XamlParseException: XAML parsing failed.
at Windows.UI.Xaml.Application.LoadComponent(Object component, Uri resourceLocator, ComponentResourceLocation componentResourceLocation)
at DMX.Helper.CameraCaptureUI.InitializeComponent()
at DMX.Helper.CameraCaptureUI..ctor()
at Plugin.Media.MediaImplementation.d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Media.WP.MainPage.d__11.MoveNext()

There is a small test project in the attachment to check and reproduce this bug.

Media.WP.zip

Copied from original issue: jamesmontemagno/Xamarin.Plugins#321

Media Plugin 2.4.0-pre is not rotating or resizing images in android due to Out of Memory Exceptions

From @dhaligas on April 14, 2016 15:21

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.4.0-pre3
Device Tested On: Samsung Galaxy S5
Simulator Tested On:

Expected Behavior

I am taking a photo with the photo size of small and I expect the result to be rotated and resized.

Actual Behavior

When debugging the MediaAndroidTest app I am getting Out of Memory exceptions when it tries to FixOrientationAync and ResizeImage

Steps to reproduce the Behavior

Run MediaAndroidTest on Debug on Device
Take Photo

Copied from original issue: jamesmontemagno/Xamarin.Plugins#279

PickPhotoAsync() do not return and exception was rethrown by the finalizer thread

Bug

Version Number of Plugin: 2.3.0
Device Tested On: Nexus 5, Andoird 4.4.2
Simulator Tested On: None

Expected Behavior

await PickPhotoAsync() should return a MediaFile object or throw exception immediately

Actual Behavior

PickPhotoAsync() never return, and a exception was rethrown by the finalizer thread.

Below is the full error message reported by Hockey App:

Xamarin caused by: android.runtime.JavaProxyThrowable: System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> Java.Lang.SecurityException: Permission Denial: reading com.google.android.apps.photos.contentprovider.MediaContentProvider uri content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Ffile%2F1718/ORIGINAL/NONE/1254058475 from pid=2238, uid=10325 requires the provider be exported, or grantUriPermission()
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7d71f658 + 0x00024> in <filename unknown>:0 
  at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualObjectMethod (JniObjectReference instance, JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) <0x7c32f828 + 0x000ef> in <filename unknown>:0 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) <0x7d648080 + 0x000af> in <filename unknown>:0 
  at Android.Content.ContentResolver.OpenInputStream (Android.Net.Uri uri) <0x86fe47c0 + 0x0016f> in <filename unknown>:0 
  at Plugin.Media.MediaPickerActivity+<>c__DisplayClass32_0.<GetFileForUriAsync>b__0 () <0x86fe0bc8 + 0x00233> in <filename unknown>:0 
  at System.Threading.Tasks.Task.InnerInvoke () <0x7f53aab0 + 0x0004f> in <filename unknown>:0 
  at System.Threading.Tasks.Task.Execute () <0x7d185b48 + 0x0004f> in <filename unknown>:0 
  --- End of inner exception stack trace ---
---> (Inner Exception #0) Java.Lang.SecurityException: Permission Denial: reading com.google.android.apps.photos.contentprovider.MediaContentProvider uri content://com.google.android.apps.photos.contentprovider/-1/1/content%3A%2F%2Fmedia%2Fexternal%2Ffile%2F1718/ORIGINAL/NONE/1254058475 from pid=2238, uid=10325 requires the provider be exported, or grantUriPermission()
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7d71f658 + 0x00024> in <filename unknown>:0 
  at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualObjectMethod (JniObjectReference instance, JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) <0x7c32f828 + 0x000ef> in <filename unknown>:0 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) <0x7d648080 + 0x000af> in <filename unknown>:0 
  at Android.Content.ContentResolver.OpenInputStream (Android.Net.Uri uri) <0x86fe47c0 + 0x0016f> in <filename unknown>:0 
  at Plugin.Media.MediaPickerActivity+<>c__DisplayClass32_0.<GetFileForUriAsync>b__0 () <0x86fe0bc8 + 0x00233> in <filename unknown>:0 
  at System.Threading.Tasks.Task.InnerInvoke () <0x7f53aab0 + 0x0004f> in <filename unknown>:0 
  at System.Threading.Tasks.Task.Execute () <0x7d185b48 + 0x0004f> in <filename unknown>:0 <---
at dalvik.system.NativeStart.run(Native Method)

Steps to reproduce the Behavior

"var file = await CrossMedia.Current.PickPhotoAsync()" on a nexus 5 device caused this issue.

TakeVideoAsync is deleting other photos and videos on S7 running android 6.0.1

From @garybettman on May 13, 2016 14:45

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.3.0
Device Tested On: S7 running android 6.0.1
Simulator Tested On:

Expected Behavior

When using TakeVideoAsync it should be creating a new video file

Actual Behavior

It is not creating a new file and is actually deleting existing images and videos inside my camera directory. It is not deleting images in folders such as downloads. This is working fine on iOS and other android devices running older versions. I don't know if it is the S7 or android 6.0.1

Steps to reproduce the Behavior

Make sure you have multiple images and videos in the Camera's folder. If there is just one it seems to work.
Create a new xamarin forms app.
Create a button that when clicked fires off TakeVideoAsync .
Take a video.
Click ok to accept video.
You will notice that an image or video has been removed from the Gallery.

Copied from original issue: jamesmontemagno/Xamarin.Plugins#305

Thumbnails are not displayed when running on iPads (at iPhone resolution)

From @dzolnjan on April 22, 2016 15:58

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin:
Device Tested On: none
Simulator Tested On: iPad Air, iPad Retina, iPad Pro

Expected Behavior

When running on iPad (at iPhone resolution) then photo picker is not displaying album and photo thumbnails (only placeholders)

This functionality is required for apps that are targeting only iPhones.

2.10 - iPhone Apps must also run on iPad without modification, at iPhone resolution, and at 2X iPhone 3GS resolution

Actual Behavior

Album and Photo thumbnails are displayed.

Steps to reproduce the Behavior

Simply start debugging MediaTest.iOS project with any of iPads simulators listed above and tap on 'Pick P' option.

Copied from original issue: jamesmontemagno/Xamarin.Plugins#290

Photo taken from camera rotates to wrong direction

Bug

Taking a photo from camera rotates the image to the wrong direction.

Version Number of Plugin: 2.4.0-beta2 and 2.4.0-beta3
Device Tested On: Motorola XT890
Simulator Tested On: VS Emulator for Android - 5.7'' Marshmallow (Android 6.0) - Similar to Samsung Galaxy Note 4

Expected Behavior

Image should be on the same orientation as shown while using the camera

Actual Behavior

Image gets rotated 90ΒΊ CCW

Steps to reproduce the Behavior

Take a photo from camera and show it in an Image from Xamarin Forms

Taking picture not working on Android 5.1.1

From @schiari on April 26, 2016 20:9

I'm using the Plugin.Media version 2.4.0-beta (which fixes picture orientation), it's working on Adroind 4.1.2 (Jelly Bean) and Marshmallow, but NOT on my new Galaxy S5 Neo with Android version 5.1.1
Basically when I take a picture it never returns back on the page from where I started the process; always returns back to the initial home page.
On devices where it works, when I take a picture, I see that first of all the application fires OnSleep, then after taking the picture fires OnResume.
On my device where is NOT working it fires OnSleep and after taking the picture doesn't fire OnResume, it fires the initialization page and then OnStart.
For this reason it doesn't open the page where I was taking the picture.
What should I do to make sure it fires OnResume returning to the correct page and not OnStart which returns on initial fome page ?

In addition, when I take a picture it takes almost 30 seconds to get back to the code after awaiting TakePhotoAsync process, and it's too slow!

Curiosity.. when debuggin, if I put a break point on "Xamarin.Android MainApplication.cs" on "OnActivitySaveInstanceState" (without changing any code, just the beark point) then it works and come back to the right page after taking the photo. Executing the same code without stopping for a second on the break point then it doesn't work..

Please help !!!
Thank you in advance
.

Copied from original issue: jamesmontemagno/Xamarin.Plugins#293

Application does not resume after calling CrossMedia.Current.TakePhotoAsync (Windows Phone)

From @pauldiston on June 9, 2016 15:6

Please take a moment to fill out the following (change to preview to check or place x in []) and remove all unused areas

This is a

  • Bug

Which plugin does this impact:

  • Media

Bug

Version Number of Plugin: 2.3.0
Device Tested On: Microsoft Lumia 640

Expected Behavior

Application should resume after calling CrossMedia.Current.TakePhotoAsync

Actual Behavior

After calling CrossMedia.Current.TakePhotoAsync, and accepting the taken image, the Resuming... message appears on the phone however the next line after calling TakePhotoAsync is never called. In release mode, the application will crash.

Steps to reproduce the Behavior

  1. Call CrossMedia.Current.TakePhotoAsync
  2. Accept taken photo
    3.Notice that the application doesn't resume

Copied from original issue: jamesmontemagno/Xamarin.Plugins#326

XAMLParseException in CrossMedia.Current.TakePhotoAsync - WindowsPhone

Please fill out either the bug or feature request section and remove whatever section you are not using.

Bug

Version Number of Plugin: 2.3.0
Device Tested On: Emulator Windows Phone
Simulator Tested On: Emulator 8.1 WVGA 4 inch 512MB

Expected Behavior

Show Camera

Actual Behavior

Crash with XAML parseException when executing:

Steps to reproduce the Behavior

When executing the following code crash with XAMLParseException:

var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
{
Directory = "AAAAA",
Name = string.Format("aaaa_{0}.jpg", DateTime.Now.ToString("yyyyMMddhhmmss", CultureInfo.InvariantCulture))
});

Feature Request:

How to fix it

Thank you very much

[Media] Taking a video on Marshmallow(6.0.1) always returns null.

From @swansca79 on May 10, 2016 13:0

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.3.0
Device Tested On: Nexus 6P 6.0.1 w/ April Security patches
Simulator Tested On:

Expected Behavior

Taking a video should return a MediaFile result.

Actual Behavior

Always returns null.

Steps to reproduce the Behavior

When this was originally implemented it worked, and all I can say for sure
was that it was before the April security patches on my Nexus 6P. This bug does not happen on pre-marshmallow devices.

  1. New forms project 2.2.0.31 (also happens on 2.1.0.6529)
  2. Add media plugin
  3. Run this code
async void MakeNewVideo(){
  IMedia media = CrossMedia.Current;
  await media.Initialize ();
  if (media.IsTakeVideoSupported) {
    MediaFile result = await media.TakeVideoAsync (new StoreVideoOptions (){ Quality= VideoQuality.Medium });
     if (result != null) {
        VideoPathLabel.Text += result.Path;
      } 
  } 
}

Copied from original issue: jamesmontemagno/Xamarin.Plugins#297

[Media] iOS: Portrait photo appears as Landscape (stretched to fill landscape) when using PhotoSize.Small

From @CliffCawley on May 15, 2016 21:50

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate

Version Number of Plugin: 2.4.0-beta2
Device Tested On: iPhone 6s
Simulator Tested On:

Expected Behavior

Portrait photo to appear as portrait photo

Actual Behavior

Portrait photo appears to be resized to be landscape (not rotated) so image is stretched horizontally

Steps to reproduce the Behavior

Take a photo using PhotoSize.Small (Possibly others also don't work)

MediaFile file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions {
                Directory = "Media",
                Name = "MyFilename.jpg",
                PhotoSize = PhotoSize.Small
            });
            if (file != null)
            {
                // Load into an image control and you'll see the image is stretched horizontally.
            }

Copied from original issue: jamesmontemagno/Xamarin.Plugins#306

Pick Photo issues

From @Sheko7 on May 18, 2016 14:31

This is a

  • Bug

Which plugin does this impact:

  • Media

Version Number of Plugin: 2.3.0
Device Tested On: Samsung Galaxy S4
Simulator Tested On:

Expected Behavior

Pick a Picture from gallery a show on a image

Actual Behavior

Pick a picture from gallery and isn't showing on Galaxy S4, but in Galaxy S7 is showing correctly

Steps to reproduce the Behavior

I use this code

  private async void OnPickPhotoClicked(object sender, EventArgs e)
  {
      if (!CrossMedia.Current.IsPickPhotoSupported)
      {
          await DisplayAlert("Photos Not Supported", ":( Permission not granted to photos.", "OK");
          return;
      }
      var file = await CrossMedia.Current.PickPhotoAsync();

      if (file == null)
          return;
      image.Source = ImageSource.FromStream(() =>
      {
          var stream = file.GetStream();
          file.Dispose();
          return stream;
      });
  }

The stream return this path:
/storage/emulated/0/Android/data/com.mypackage/files/Pictures/temp/IMG_20160518_155754.jpg

And I have these permissions:
WRITE_EXTERNAL_STORAGE
READ_EXTERNAL_STORAGE
CAMERA

Copied from original issue: jamesmontemagno/Xamarin.Plugins#308

App shoots back when camera orientation is changed

From @MoffApps on March 2, 2016 16:40

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • [ x] Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • [ x] Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin:Xam.Plugin.Media.2.3.0
Device Tested On:Oneplus x
Simulator Tested On:

Expected Behavior

When in camera view and it is rotated everything works as normal

Actual Behavior

Where camera is rotated and picture taken. App shoots back to start screen

Steps to reproduce the Behavior

Launch camera in portrait, switch to landscape, take photo and ok it

Copied from original issue: jamesmontemagno/Xamarin.Plugins#235

[Feature Request] Overwrite file

Please fill out either the bug or feature request section and remove whatever section you are not using.

Bug

Version Number of Plugin:
Device Tested On:
Simulator Tested On:

Expected Behavior

Actual Behavior

Steps to reproduce the Behavior

Feature Request:

Plugin.Media.Abstractions.StoreCameraOptions would have a bool overwrite option, to overwite the file in the current directory if found, instead to rename _2 _3 etc.

Huge delay or not opening camera Iphone SE

From @ppun51 on June 22, 2016 16:41

Which Plugin does this impact: Xamarin Plug IN 2.30

Please fill out either the bug or feature request section and remove whatever section you are not using.
No Bug number for this issue

Version Number of Plugin:
Device Tested On: Iphone SE
Simulator Tested On: No

Some times opening camera with Huge delay or not opening camera.
When open camera, all of buttons are freeze with black screen until I touch middle of screen.

Do you have anyone have this issue?
I am about to test it with Iphone 6S.

Is there any limit for this plug in to supports?

Copied from original issue: jamesmontemagno/Xamarin.Plugins#342

iOS devices can't recognize if there are no camera permission

From @Brosten on June 15, 2016 9:52

Please take a moment to fill out the following (change to preview to check or place x in []) and remove all unused areas

This is a

  • [] Bug
  • Feature Request

Which plugin does this impact:

  • [] Battery
  • [] Connectivity
  • [] Contacts
  • [] DeviceInfo
  • [] ExternalMaps
  • [] Geolocator
  • Media
  • [] Permissions
  • [] Settings
  • [] Text To Speech
  • [] Vibrate
  • Other:

Bug

Version Number of Plugin: 2.3
Device Tested On: ipad air 2
Simulator Tested On:

Expected Behavior

Actual Behavior

Steps to reproduce the Behavior

Feature Request:

There should be a property telling whatever the app has permission to use the camera or not. For the moment I have to implement this in my own iOS code. Should be nice if it were included in the CrossMedia

Copied from original issue: jamesmontemagno/Xamarin.Plugins#332

Size of image selected

Feature Request:
Hi, Is there any way I can get the size of the images I select. I know that it is planned for future versions (I am guessing the image metadata provides that information )but in the interim, if there is any way which I can obtain the size of the image selected, may be from the stream or something like that.

Thanks,
Madan

[Android] Save to Album doesn't also save to app directory

Bug

Version Number of Plugin: 2.5.1
Tested On: Sim & Device

Expected Behavior

When SaveToAlbum is true the image should be saved to both app directory and also to the public album

Public should be unmodified and temp directory should be shrunk and modified.

Actual Behavior

Currently only saved to public album

Steps to reproduce the Behavior

Take photo on Android with SaveToAlbum = true. It will save to album, but not local.

iOS will save to both.

[Feature Request] Ability to take multiple pictures before exiting the camera app.

Please fill out either the bug or feature request section and remove whatever section you are not using.

Bug

Version Number of Plugin:
Device Tested On:
Simulator Tested On:

Expected Behavior

Actual Behavior

Steps to reproduce the Behavior

Feature Request:

It would be useful to be able to take several pictures in a row before returning to the calling method. Rather than doing: Tap "Take a Photo" button; take a picture; accept it (tap the check mark - on android); Tap "Take a Photo" button; etc until done. It would be preferable to avoid the [Tap "Take a Photo" button; ] step for subsequent pictures. When done, we could tap the back button.
Thanks for considering this request

Localisation support

Feature Request:

It would be nice if we could change the description of "Cancel", "Take photo", "Use photo" and "Retake" so it can match the app's language.

Media - Camera images taken in portrait behaving weird.

From @HIGHPlains on March 28, 2016 21:53

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • [X ] Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.4.0-beta3
Device Tested On: iPhone 6s+
Simulator Tested On: iPhone 6s

Expected Behavior

Take a photo in portrait, photo is saved/displays in correct dimensions.

Actual Behavior

Photo looks like its been stretched into landscape

Steps to reproduce the Behavior

Take a photo in portrait, same photo in landscape. Load in to a ImageView AspectFit

Stable Version.
screen shot 2016-03-28 at 3 38 57 pm

Latest Beta
screen shot 2016-03-28 at 3 39 06 pm

Copied from original issue: jamesmontemagno/Xamarin.Plugins#263

How to solve Xaml parsing error for media.plugin in windows phone 8.1 PCL project?

From @rylegale on April 5, 2016 9:22

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a Bug

  • [ ] Bug
  • Feature Request

Which plugin does this impact: Media

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • [ ] Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: 2.3.0
Device Tested On:
Simulator Tested On: Windows Phone 8.1

Expected Behavior

Actual Behavior

XAML parsing failed.

Steps to reproduce the Behavior

I've created a PCL project and the plugin is working so good in Android and iOS but not in Windows Phone 8.1 RT, I've added the lines in App.xaml.cs but when I try to take picture, it throws an error XAML parsing failed in TakePhotoAsync method. I've also tried to download and manually added the dll file but again the same error.

Copied from original issue: jamesmontemagno/Xamarin.Plugins#269

[FEATURE REQUEST]Allow Picking All Sorts of Media Types ex. Audio

Please fill out either the bug or feature request section and remove whatever section you are not using.

Bug

Version Number of Plugin: 2.3.0
Device Tested On: N/A
Simulator Tested On: N/A

Expected Behavior

Actual Behavior

Can only pick images and videos

Steps to reproduce the Behavior

N/A

Feature Request:

Should be able to Pick all sorts o media files, mp3, pdf e.t.c

Android 6.0 only Media issue

From @michaeldimoudis on April 15, 2016 4:23

This is a

  • Bug
  • Feature Request

Which plugin does this impact:

  • Battery
  • Connectivity
  • Contacts
  • DeviceInfo
  • ExternalMaps
  • Geolocator
  • Media
  • Permissions
  • Settings
  • Text To Speech
  • Vibrate
  • Other:

Version Number of Plugin: latest
Device Tested On: Android 6 devices
Simulator Tested On: Android 6

Expected Behavior

When I click on a button to load a photo gallery, I get asked for permission, and the photo gallery should pop up.

Actual Behavior

After you give permission for Android 6 to access the camera, the photo gallery doesn't pop up. Even after you press the button multiple times. If you navigate away from the page, and go back in to the page with the button to pop up the gallery, it then starts working as expected and pops up.

Steps to reproduce the Behavior

See above.

Copied from original issue: jamesmontemagno/Xamarin.Plugins#283

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.