djaus2_MauiMediaRecorderVideoLib 1.1.2
See the version list below for details.
dotnet add package djaus2_MauiMediaRecorderVideoLib --version 1.1.2
NuGet\Install-Package djaus2_MauiMediaRecorderVideoLib -Version 1.1.2
<PackageReference Include="djaus2_MauiMediaRecorderVideoLib" Version="1.1.2" />
<PackageVersion Include="djaus2_MauiMediaRecorderVideoLib" Version="1.1.2" />
<PackageReference Include="djaus2_MauiMediaRecorderVideoLib" />
paket add djaus2_MauiMediaRecorderVideoLib --version 1.1.2
#r "nuget: djaus2_MauiMediaRecorderVideoLib, 1.1.2"
#:package djaus2_MauiMediaRecorderVideoLib@1.1.2
#addin nuget:?package=djaus2_MauiMediaRecorderVideoLib&version=1.1.2
#tool nuget:?package=djaus2_MauiMediaRecorderVideoLib&version=1.1.2
MauiMediaRecorderVideoLib
A .NET MAUI library for Android video recording using MediaRecorder with camera preview and stabilization features.
Update: Have resolved issue to do with permssions. Now waits for the user to accept Camera before starting the camera preview. Should now work in Release version of host app. (2Do)
Note also: Audio permissions are not reuqested as not catured. Video only.
Features
- Full-screen camera preview
- Video recording with MediaRecorder
- No audio recording
- Image stabilization options (Standard or Locked)
- Camera rotation support (0, 90, 180, 270 degrees)
- Configurable video FPS (30, 60, or default)
- Support for pausing and resuming recording
- Proper handling of Android permissions
- Screen dimensions detection for optimal preview
Usage with a MAUI Android Phone App
Installation
Start by creating a new .NET MAUI project or using an existing one.
Install the package via NuGet:
dotnet add package MauiMediaRecorderVideoLib
Also need to install the following NuGet package:
dotnet add package CommunityToolkit.Maui.Camera
Nb: CommunityToolkit.Maui.Camera is in the library but needs a reference in the App as it uses the Toolkit Peview.
Basic Setup
- Add the required permissions to your Android Manifest:
<uses-permission android:name="android.permission.CAMERA" />
Note: In app Android//MainActivity calls permissions setup via static method in library that iterates through in-app Android/Manifest permissions.
The following needs updating (2Do).
- Initialize the video recorder service:
using MauiMediaRecorderVideoLib;
// Initialize the service
var videoRecorderService = new AndroidVideoRecorderService();
await videoRecorderService.InitializeAsync();
- Start the camera preview:
// Assuming you have a GraphicsView named 'cameraPreview' in your XAML
videoRecorderService.SetPreviewSurface(cameraPreview);
- Start recording:
// Configure recording options
videoRecorderService.SetVideoFPS(30); // Optional: Set FPS
videoRecorderService.SetImageStabilization(StabilizationMode.Locked); // Optional: Set stabilization
// Start recording
string outputFilePath = Path.Combine(FileSystem.CacheDirectory, "myVideo.mp4");
await videoRecorderService.StartRecordingAsync(outputFilePath);
- Control recording:
// Pause recording
await videoRecorderService.PauseRecordingAsync();
// Resume recording
await videoRecorderService.ResumeRecordingAsync();
// Stop recording
await videoRecorderService.StopRecordingAsync();
- Clean up resources:
// Release resources when done
await videoRecorderService.CleanupAsync();
Requirements
- .NET MAUI project targeting Android
- Android API level 21 or higher
- Requires Android device with camera
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0-android35.0 is compatible. net10.0-android was computed. |
-
net9.0-android35.0
- CommunityToolkit.Maui.Camera (>= 2.0.3)
- Microsoft.Extensions.Logging.Debug (>= 9.0.4)
- Microsoft.Maui.Controls (>= 9.0.60)
- Microsoft.Maui.Controls.Compatibility (>= 9.0.60)
- Xamarin.AndroidX.Camera.Camera2 (>= 1.4.2.1)
- Xamarin.AndroidX.Camera.Core (>= 1.4.2.1)
- Xamarin.AndroidX.Camera.Lifecycle (>= 1.4.2.1)
- Xamarin.AndroidX.Camera.Video (>= 1.4.2.1)
- Xamarin.AndroidX.Camera.View (>= 1.4.2.1)
- Xamarin.AndroidX.Core (>= 1.16.0.1)
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 |
---|---|---|
3.0.2 | 148 | 7/16/2025 |
3.0.1 | 141 | 7/16/2025 |
3.0.0 | 143 | 7/16/2025 |
2.5.1 | 98 | 7/11/2025 |
2.5.0 | 103 | 7/11/2025 |
2.4.3 | 142 | 7/6/2025 |
2.4.2 | 142 | 7/6/2025 |
2.4.0 | 138 | 7/6/2025 |
2.3.0 | 143 | 7/6/2025 |
2.2.2 | 156 | 6/19/2025 |
2.2.1 | 155 | 5/23/2025 |
2.2.0 | 158 | 5/21/2025 |
2.1.2 | 154 | 5/20/2025 |
2.1.1 | 238 | 5/15/2025 |
2.1.0 | 248 | 5/14/2025 |
2.0.3 | 231 | 5/14/2025 |
2.0.2 | 242 | 5/14/2025 |
2.0.1 | 237 | 5/13/2025 |
2.0.0 | 246 | 5/13/2025 |
1.1.3 | 148 | 5/11/2025 |
1.1.2 | 150 | 5/11/2025 |
1.1.0 | 153 | 5/11/2025 |
1.0.3 | 162 | 5/7/2025 |
1.0.2 | 161 | 5/7/2025 |
1.0.1 | 153 | 5/6/2025 |
1.0.0 | 160 | 5/6/2025 |