Xamarin.MediaCapture
1.0.0
dotnet add package Xamarin.MediaCapture --version 1.0.0
NuGet\Install-Package Xamarin.MediaCapture -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xamarin.MediaCapture" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xamarin.MediaCapture --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Xamarin.MediaCapture, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Xamarin.MediaCapture as a Cake Addin #addin nuget:?package=Xamarin.MediaCapture&version=1.0.0 // Install Xamarin.MediaCapture as a Cake Tool #tool nuget:?package=Xamarin.MediaCapture&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NetworkManager
A cross platform wrapper for MediaCapture on iOS and Android
Usage:
using Subsystems.MediaCaptureShared.External;;
... ...
private CMPMediaCaptureSharedProxy _mediaCaptureProxy;
Initialize
_mediaCaptureProxy = new CMPMediaCaptureSharedProxy();
CaptureMediaAsync
var capturedBytes = await _mediaCaptureProxy?.CaptureMediaAsync();
CapturedImage.Source = ImageSource.FromStream(() =>
{
return (new MemoryStream(capturedBytes));
});
CheckSelfPermission (Android)
var capturePermissionInfo = CheckSelfPermission(Manifest.Permission.Camera);
if (capturePermissionInfo == Permission.Denied)
RequestPermissions(new string[] { Manifest.Permission.Camera }, 1);
else
{
_mediaCaptureProxy = new CMPMediaCaptureSharedProxy(this);
Xamarin.Forms.Application.Current.Properties["p1"] = _mediaCaptureProxy;
}
OnRequestPermissionsResult (Android)
public override void OnRequestPermissionsResult(int requestCode,
string[] permissions,
Permission[]
grantResults)
{
base.OnRequestPermissionsResult(requestCode,
permissions,
grantResults);
if (requestCode != 1)
return;
if (grantResults[0] != Permission.Granted)
return;
_mediaCaptureProxy = new CMPMediaCaptureSharedProxy(this);
Xamarin.Forms.Application.Current.Properties["p1"] = _mediaCaptureProxy;
}
OnActivityResult (Android)
protected override void OnActivityResult(int requestCode,
Result resultCode,
Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
if (requestCode != 1)
return;
if (data == null)
return;
Bitmap bitmap = null;
if (data.Data == null) // camera
bitmap = data.Extras.Get("data") as Bitmap;
else
{
var uri = data.Data;
var imageStream = ContentResolver.OpenInputStream(uri);
bitmap = BitmapFactory.DecodeStream(imageStream);
}
_mediaCaptureProxy.CancelCapture(bitmap);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
MonoAndroid | monoandroid90 is compatible. |
Xamarin.iOS | xamarinios10 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
MonoAndroid 9.0
- Autofac (>= 4.8.1)
- Microsoft.NETCore.Platforms (>= 2.1.1)
- Microsoft.Win32.Primitives (>= 4.3.0)
- NETStandard.Library (>= 2.0.3)
- System.AppContext (>= 4.3.0)
- System.Collections (>= 4.3.0)
- System.Collections.Concurrent (>= 4.3.0)
- System.ComponentModel (>= 4.3.0)
- System.Console (>= 4.3.1)
- System.Diagnostics.Debug (>= 4.3.0)
- System.Diagnostics.Tools (>= 4.3.0)
- System.Diagnostics.Tracing (>= 4.3.0)
- System.Globalization (>= 4.3.0)
- System.Globalization.Calendars (>= 4.3.0)
- System.IO (>= 4.3.0)
- System.IO.Compression (>= 4.3.0)
- System.IO.Compression.ZipFile (>= 4.3.0)
- System.IO.FileSystem (>= 4.3.0)
- System.IO.FileSystem.Primitives (>= 4.3.0)
- System.Linq (>= 4.3.0)
- System.Linq.Expressions (>= 4.3.0)
- System.Net.Http (>= 4.3.4)
- System.Net.Primitives (>= 4.3.0)
- System.Net.Sockets (>= 4.3.0)
- System.ObjectModel (>= 4.3.0)
- System.Reflection (>= 4.3.0)
- System.Reflection.Extensions (>= 4.3.0)
- System.Reflection.Primitives (>= 4.3.0)
- System.Resources.ResourceManager (>= 4.3.0)
- System.Runtime (>= 4.3.0)
- System.Runtime.Extensions (>= 4.3.0)
- System.Runtime.Handles (>= 4.3.0)
- System.Runtime.InteropServices (>= 4.3.0)
- System.Runtime.InteropServices.RuntimeInformation (>= 4.3.0)
- System.Runtime.Numerics (>= 4.3.0)
- System.Security.Cryptography.Algorithms (>= 4.3.1)
- System.Security.Cryptography.Encoding (>= 4.3.0)
- System.Security.Cryptography.Primitives (>= 4.3.0)
- System.Security.Cryptography.X509Certificates (>= 4.3.2)
- System.Text.Encoding (>= 4.3.0)
- System.Text.Encoding.Extensions (>= 4.3.0)
- System.Text.RegularExpressions (>= 4.3.0)
- System.Threading (>= 4.3.0)
- System.Threading.Tasks (>= 4.3.0)
- System.Threading.Timer (>= 4.3.0)
- System.Xml.ReaderWriter (>= 4.3.1)
- System.Xml.XDocument (>= 4.3.0)
-
Xamarin.iOS 1.0
- Autofac (>= 4.8.1)
- Microsoft.NETCore.Platforms (>= 2.1.1)
- Microsoft.Win32.Primitives (>= 4.3.0)
- NETStandard.Library (>= 2.0.3)
- System.AppContext (>= 4.3.0)
- System.Collections (>= 4.3.0)
- System.Collections.Concurrent (>= 4.3.0)
- System.ComponentModel (>= 4.3.0)
- System.Console (>= 4.3.1)
- System.Diagnostics.Debug (>= 4.3.0)
- System.Diagnostics.Tools (>= 4.3.0)
- System.Diagnostics.Tracing (>= 4.3.0)
- System.Globalization (>= 4.3.0)
- System.Globalization.Calendars (>= 4.3.0)
- System.IO (>= 4.3.0)
- System.IO.Compression (>= 4.3.0)
- System.IO.Compression.ZipFile (>= 4.3.0)
- System.IO.FileSystem (>= 4.3.0)
- System.IO.FileSystem.Primitives (>= 4.3.0)
- System.Linq (>= 4.3.0)
- System.Linq.Expressions (>= 4.3.0)
- System.Net.Http (>= 4.3.4)
- System.Net.Primitives (>= 4.3.0)
- System.Net.Sockets (>= 4.3.0)
- System.ObjectModel (>= 4.3.0)
- System.Reflection (>= 4.3.0)
- System.Reflection.Extensions (>= 4.3.0)
- System.Reflection.Primitives (>= 4.3.0)
- System.Resources.ResourceManager (>= 4.3.0)
- System.Runtime (>= 4.3.0)
- System.Runtime.Extensions (>= 4.3.0)
- System.Runtime.Handles (>= 4.3.0)
- System.Runtime.InteropServices (>= 4.3.0)
- System.Runtime.InteropServices.RuntimeInformation (>= 4.3.0)
- System.Runtime.Numerics (>= 4.3.0)
- System.Security.Cryptography.Algorithms (>= 4.3.1)
- System.Security.Cryptography.Encoding (>= 4.3.0)
- System.Security.Cryptography.Primitives (>= 4.3.0)
- System.Security.Cryptography.X509Certificates (>= 4.3.2)
- System.Text.Encoding (>= 4.3.0)
- System.Text.Encoding.Extensions (>= 4.3.0)
- System.Text.RegularExpressions (>= 4.3.0)
- System.Threading (>= 4.3.0)
- System.Threading.Tasks (>= 4.3.0)
- System.Threading.Timer (>= 4.3.0)
- System.Xml.ReaderWriter (>= 4.3.1)
- System.Xml.XDocument (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 999 | 10/22/2018 |
1. Initial Release for Media Capture component
2. Supports latest iOS nad Android