You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
Version Number of Plugin: 4.0.1.5
Device Tested On: iPad Air
Simulator Tested On: iPad Air2
Version of VS: 7.5.2(build 40)
Version of Xamarin: Xamarin.Mac Version: 4.4.1.193
Versions of other things you are using:
Xamarin.iOS Version: 11.12.0.4
Xamarin Forms Version 3.0.0.482510
Permissions Plugin Version 3.0.0.12
Acr.UserDialogs Plugin Version 7.0.1
Steps to reproduce the Behavior
Create a new forms project;
Install plugins;
Add a button that that will allow to select a video when clicked;
Select a video;
Tap "Use";
While video is compressing, tap anywhere outside "select video" view;
public static async Task<string> SelectVideo(ContentPage contentPage)
{
PermissionStatus status = PermissionStatus.Unknown;
status = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.MediaLibrary);
if (status != PermissionStatus.Granted)
{
if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.MediaLibrary))
await UserDialogs.Instance.AlertAsync("Sharesafe Health requires your permission to access videos", "Need Permission");
Dictionary<Permission, PermissionStatus> results = await CrossPermissions.Current.RequestPermissionsAsync(new[] { Permission.MediaLibrary });
status = results[Permission.MediaLibrary];
}
if (status == PermissionStatus.Granted)
return await actuallySelectVideo(contentPage);
else if (status != PermissionStatus.Unknown)
{
ConfirmConfig confirmConfig = new ConfirmConfig
{
Message = "This feature requires you to grant it MediaLibrary Permissions. To do this, Go to Settings, tap the Permissions link and select ON for the MediaLibrary Permission.",
Title = "Storage Permission Denied",
OkText = "Go to app Settings",
CancelText = "Cancel"
};
confirmConfig.OnAction += (bool gotoSettings) =>
{
if (gotoSettings)
CrossPermissions.Current.OpenAppSettings();
};
UserDialogs.Instance.Confirm(confirmConfig);
}
return null;
}
private static async Task<string> actuallySelectVideo(ContentPage contentPage)
{
MediaFile file = null;
string path = "";
if (CrossMedia.Current.IsPickVideoSupported)
file = await CrossMedia.Current.PickVideoAsync();
else
UserDialogs.Instance.Alert("Access to media declined", "Edit your phone's privacy settings to allow this feature.", "OK");
if (file == null)
return null;
else
return path;
}
`
Screenshots
The text was updated successfully, but these errors were encountered:
Version Number of Plugin: 4.0.1.5
Device Tested On: iPad Air
Simulator Tested On: iPad Air2
Version of VS: 7.5.2(build 40)
Version of Xamarin: Xamarin.Mac Version: 4.4.1.193
Versions of other things you are using:
Steps to reproduce the Behavior
Expected Behavior
Actual Behavior
###StackTrace
https://gist.github.com/andreiionita/47f5664ca3ae7aa461c20a0b750ecafb
Code snippet
`
async void Handle_Clicked(object sender, System.EventArgs e)
{
string media = await SelectVideo(this);
}
`
Screenshots
The text was updated successfully, but these errors were encountered: