Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
313a3b6
Camera Video Recording
VladislavAntonyuk Jun 12, 2025
9aded49
Android Write to file
VladislavAntonyuk Jun 14, 2025
50055e3
Fix recording
VladislavAntonyuk Jun 15, 2025
bcdfcaf
Fix windows recording
VladislavAntonyuk Jun 15, 2025
ae96f4d
check for null
VladislavAntonyuk Jun 15, 2025
a866b74
Fix to work with old devices
VladislavAntonyuk Jun 15, 2025
c72a293
Add camera extensions to android
VladislavAntonyuk Jun 21, 2025
4fbfac9
Fix crash
VladislavAntonyuk Jun 21, 2025
803e21f
updatr csproj
VladislavAntonyuk Jun 23, 2025
8f4f1c6
Merge branch 'main' into feature/camera-video-recording
VladislavAntonyuk Jun 26, 2025
02ef483
Merge branch 'main' into feature/camera-video-recording
ne0rrmatrix Jul 3, 2025
5ae086d
Merge branch 'main' into feature/camera-video-recording
VladislavAntonyuk Jul 6, 2025
e5fb573
Fix merge conflicts
VladislavAntonyuk Jul 6, 2025
be1ef9e
implement ios
VladislavAntonyuk Jul 6, 2025
f23cd6b
fix build
VladislavAntonyuk Jul 6, 2025
8f74aa9
Fix sample app
VladislavAntonyuk Jul 7, 2025
0b336c1
Fix video recording finalization
VladislavAntonyuk Jul 7, 2025
d42d978
Move stream as input parameter to avoid memory streams
VladislavAntonyuk Jul 7, 2025
e8b8a26
Fixes video recording stream handling
VladislavAntonyuk Jul 8, 2025
fb1d056
Updates PlatformStartVideoRecording signature
VladislavAntonyuk Jul 8, 2025
d76920d
Fix Android extension modes
VladislavAntonyuk Jul 16, 2025
0f0c926
Rework Android binding and add iOS implementation
VladislavAntonyuk Jul 19, 2025
331b990
Add video recording controls and improve async handling
VladislavAntonyuk Jul 19, 2025
81ef874
Merge branch 'main' into feature/camera-video-recording
VladislavAntonyuk Jul 19, 2025
6f91cd7
Add summary
VladislavAntonyuk Jul 19, 2025
697da18
Merge branch 'feature/camera-video-recording' of https://github.com/C…
VladislavAntonyuk Jul 19, 2025
528c70d
add tests
VladislavAntonyuk Jul 19, 2025
802ca75
Merge branch 'main' into feature/camera-video-recording
ne0rrmatrix Jul 26, 2025
cdd819a
remove !
VladislavAntonyuk Jul 27, 2025
e6234a5
Merge branch 'main' into feature/camera-video-recording
ne0rrmatrix Sep 6, 2025
690dd3b
Remove unused fields
TheCodeTraveler Sep 7, 2025
cba0b9e
Implement Disposables
TheCodeTraveler Sep 7, 2025
352a7e9
Move `Stream` to CameraViewPage
TheCodeTraveler Sep 7, 2025
4354246
Move disposal of videoRecordingStream to `Dispose()`
TheCodeTraveler Sep 7, 2025
6be4152
Refactor `StartVideoRecording` to return `Task<Stream>`
TheCodeTraveler Sep 7, 2025
be07891
Revert "Refactor `StartVideoRecording` to return `Task<Stream>`"
VladislavAntonyuk Sep 12, 2025
1fab40f
Fix Apple video recording
VladislavAntonyuk Sep 12, 2025
17f202f
Requests microphone permission for video recording
VladislavAntonyuk Sep 12, 2025
f7030de
Merge branch 'main' into feature/camera-video-recording
VladislavAntonyuk Sep 12, 2025
e4d3dc1
Merge branch 'main' into feature/camera-video-recording
TheCodeTraveler Oct 14, 2025
cd5a30d
Add `ICameraView.StartVideoRecording(CancellationToken)`
TheCodeTraveler Oct 14, 2025
ceb400a
Update CameraManager.windows.cs
TheCodeTraveler Oct 14, 2025
a399058
Remove `SupportedOSPlatform`
TheCodeTraveler Oct 14, 2025
718da2a
`dotnet format`
TheCodeTraveler Oct 14, 2025
9ae9ef9
Remove unnecessary code
TheCodeTraveler Oct 15, 2025
55150a7
Update CameraViewHandler.shared.cs
TheCodeTraveler Oct 15, 2025
2b2f782
Implement `CancellationToken`
TheCodeTraveler Oct 15, 2025
4985341
Update CameraManager.macios.cs
TheCodeTraveler Oct 15, 2025
d097fed
Add `CancellationToken`
TheCodeTraveler Oct 15, 2025
86e520b
Merge branch 'main' into feature/camera-video-recording
TheCodeTraveler Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<Button Clicked="ZoomIn" Text="Zoom +" Grid.Column="2"/>
</Grid>

<Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3" BackgroundColor="#80CCCCCC">
<Grid Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="5" BackgroundColor="#80CCCCCC">

<FlexLayout Margin="5" JustifyContent="SpaceBetween" Wrap="Wrap">

Expand All @@ -76,6 +76,14 @@

<Button Command="{Binding StopCameraPreviewCommand, Source={x:Reference Camera}, x:DataType=toolkit:CameraView}"
Text="StopCameraPreview" />
<Button Command="{Binding StartVideoRecordingCommand, Source={x:Reference Camera}, x:DataType=toolkit:CameraView}"
CommandParameter="{Binding Stream}"
Text="StartVideoRecording" />

<Button Command="{Binding StopVideoRecordingCommand, Source={x:Reference Camera}, x:DataType=toolkit:CameraView}"
Text="StopVideoRecording" />

<Button Command="{Binding SaveVideoCommand}" Text="GetStream" />

</FlexLayout>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using CommunityToolkit.Maui.Core;
using CommunityToolkit.Maui.Core.Primitives;
using CommunityToolkit.Maui.Storage;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;

Expand All @@ -13,6 +14,8 @@ public partial class CameraViewViewModel(ICameraProvider cameraProvider) : BaseV

public CancellationToken Token => CancellationToken.None;

public Stream Stream { get; } = new MemoryStream();

public ICollection<CameraFlashMode> FlashModes { get; } = Enum.GetValues<CameraFlashMode>();

[ObservableProperty]
Expand Down Expand Up @@ -78,4 +81,10 @@ void UpdateResolutionText()
{
ResolutionText = $"Selected Resolution: {SelectedResolution.Width} x {SelectedResolution.Height}";
}

[RelayCommand]
async Task SaveVideo()
{
await FileSaver.SaveAsync("recording.mp4", Stream);
}
}
160 changes: 159 additions & 1 deletion src/CommunityToolkit.Maui.Camera/CameraManager.android.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
using System.Runtime.Versioning;
using System.IO;
using System.Runtime.Versioning;
using Android.Content;
using Android.Hardware.Camera2;
using Android.Hardware.Camera2.Params;
using Android.Media;
using Android.OS;
using Android.Runtime;
using Android.SE.Omapi;
using Android.Views;
using AndroidX.Camera.Core;
using AndroidX.Camera.Core.Impl.Utils.Futures;
using AndroidX.Camera.Core.ResolutionSelector;
using AndroidX.Camera.Lifecycle;
using AndroidX.Camera.Video;
using AndroidX.Core.Content;
using AndroidX.Lifecycle;
using CommunityToolkit.Maui.Extensions;
using Java.IO;
using Java.Lang;
using Java.Util.Concurrent;
using static Android.Media.Image;
using static Android.Print.PrintAttributes;
using static AndroidX.Camera.Core.Internal.CameraUseCaseAdapter;
using Exception = System.Exception;
using Math = System.Math;

namespace CommunityToolkit.Maui.Core;
Expand All @@ -32,6 +44,15 @@ partial class CameraManager
ResolutionFilter? resolutionFilter;
OrientationListener? orientationListener;

MediaRecorder? mediaRecorder;
CameraDevice? cameraDevice;
CameraCaptureSession? captureSession;
ParcelFileDescriptor? writeFd;
ParcelFileDescriptor? readFd;
Task? pipeTask;
HandlerThread? cameraThread;
Handler? cameraHandler;

public void Dispose()
{
Dispose(true);
Expand Down Expand Up @@ -258,6 +279,124 @@ protected virtual partial ValueTask PlatformTakePicture(CancellationToken token)
return ValueTask.CompletedTask;
}

protected virtual async partial Task PlatformStartVideoRecording(System.IO.Stream stream, CancellationToken token)
{
var cameraManager = (Android.Hardware.Camera2.CameraManager)context.GetSystemService(Context.CameraService)!;
var audioManager = (AudioManager)context.GetSystemService(Context.AudioService)!;

cameraThread = new HandlerThread("CameraThread");
cameraThread.Start();
cameraHandler = new Handler(cameraThread.Looper!);

mediaRecorder = OperatingSystem.IsAndroidVersionAtLeast(31)
? new MediaRecorder(context)
: new MediaRecorder();

audioManager.Mode = Mode.Normal;

mediaRecorder.SetAudioSource(AudioSource.Mic);
mediaRecorder.SetVideoSource(VideoSource.Surface);
mediaRecorder.SetOutputFormat(OutputFormat.Mpeg4);

var pipe = ParcelFileDescriptor.CreatePipe()!;
writeFd = pipe[1];
readFd = pipe[0];

mediaRecorder.SetOutputFile(writeFd.FileDescriptor);
mediaRecorder.SetVideoEncodingBitRate(10_000_000);
mediaRecorder.SetVideoFrameRate(30);
mediaRecorder.SetVideoEncoder(VideoEncoder.H264);
mediaRecorder.SetAudioEncoder(AudioEncoder.Aac);
mediaRecorder.Prepare();

// Start background streaming to .NET stream
pipeTask = Task.Run(async () =>
{
try
{
using var inputStream = new ParcelFileDescriptor.AutoCloseInputStream(readFd);
byte[] buffer = new byte[81920];
int bytesRead;
while ((bytesRead = inputStream.Read(buffer, 0, buffer.Length)) > 0 && !token.IsCancellationRequested)
{
await stream.WriteAsync(buffer.AsMemory(0, bytesRead), token);
await stream.FlushAsync(token);
}
}
catch (System.OperationCanceledException) { }
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"[VideoRecorder] CopyToAsync failed: {ex}");
}
}, token);

// Open camera and start recording session
var openTcs = new TaskCompletionSource();

var cameraCallback = new CameraStateListener(device =>
{
cameraDevice = device;

var surfaces = new List<Surface> { mediaRecorder.Surface! };
var sessionCallback = new CaptureStateListener(session =>
{
captureSession = session;
var builder = cameraDevice.CreateCaptureRequest(CameraTemplate.Record);
builder.AddTarget(mediaRecorder.Surface!);
session.SetRepeatingRequest(builder.Build(), null, cameraHandler);

mediaRecorder.Start();
openTcs.TrySetResult();
});

device.CreateCaptureSession(surfaces, sessionCallback, cameraHandler);
});

cameraManager.OpenCamera(cameraView.SelectedCamera!.DeviceId, cameraCallback, cameraHandler);

await openTcs.Task;
}

protected virtual async partial Task PlatformStopVideoRecording(CancellationToken token)
{
ArgumentNullException.ThrowIfNull(cameraExecutor);
try
{
mediaRecorder?.Stop();
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"[VideoRecorder] Stop failed: {ex}");
}

mediaRecorder?.Release();
mediaRecorder = null;

captureSession?.Close();
cameraDevice?.Close();
captureSession = null;
cameraDevice = null;

writeFd?.Close();
readFd?.Close();
writeFd = null;
readFd = null;

if (pipeTask is not null)
{
await pipeTask;
pipeTask = null;
}

if (cameraThread != null)
{
cameraThread.QuitSafely();
cameraThread.Join();
cameraThread = null;
cameraHandler = null;
}
}

void SetImageCaptureTargetRotation(int rotation)
{
if (imageCapture is not null)
Expand Down Expand Up @@ -379,4 +518,23 @@ public override void OnOrientationChanged(int orientation)
callback.Invoke(orientation);
}
}
}

public class CameraStateListener : CameraDevice.StateCallback
{
readonly Action<CameraDevice> onOpened;
public CameraStateListener(Action<CameraDevice> onOpened) => this.onOpened = onOpened;

public override void OnOpened(CameraDevice camera) => onOpened(camera);
public override void OnDisconnected(CameraDevice camera) => camera.Close();
public override void OnError(CameraDevice camera, [GeneratedEnum] CameraError error) => camera.Close();
}

public class CaptureStateListener : CameraCaptureSession.StateCallback
{
readonly Action<CameraCaptureSession> onConfigured;
public CaptureStateListener(Action<CameraCaptureSession> onConfigured) => this.onConfigured = onConfigured;

public override void OnConfigured(CameraCaptureSession session) => onConfigured(session);
public override void OnConfigureFailed(CameraCaptureSession session) => session.Close();
}
4 changes: 4 additions & 0 deletions src/CommunityToolkit.Maui.Camera/CameraManager.macios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@
{
}

protected virtual partial Task PlatformStartVideoRecording(Stream stream, CancellationToken token) => throw new NotSupportedException("notSupportedMessage");
protected virtual partial Task PlatformStopVideoRecording(CancellationToken token) => throw new NotSupportedException("notSupportedMessage");


protected virtual async partial ValueTask PlatformTakePicture(CancellationToken token)
{
ArgumentNullException.ThrowIfNull(photoOutput);
Expand All @@ -203,7 +207,7 @@
var photoOutputConnection = photoOutput.ConnectionFromMediaType(avMediaTypeVideo);
if (photoOutputConnection is not null)
{
photoOutputConnection.VideoOrientation = videoOrientation;

Check warning on line 210 in src/CommunityToolkit.Maui.Camera/CameraManager.macios.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'AVCaptureConnection.VideoOrientation' is obsoleted on: 'maccatalyst' 17.0 and later (Use VideoRotationAngle instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 210 in src/CommunityToolkit.Maui.Camera/CameraManager.macios.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (windows-latest)

This call site is reachable on: 'iOS' 15.0 and later, 'maccatalyst' 15.0 and later. 'AVCaptureConnection.VideoOrientation' is obsoleted on: 'ios' 17.0 and later (Use VideoRotationAngle instead.), 'maccatalyst' 17.0 and later (Use VideoRotationAngle instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)
}
}

Expand Down Expand Up @@ -270,7 +274,7 @@
IEnumerable<UIScene> scenes = UIApplication.SharedApplication.ConnectedScenes;
var interfaceOrientation = scenes.FirstOrDefault() is UIWindowScene windowScene
? windowScene.InterfaceOrientation
: UIApplication.SharedApplication.StatusBarOrientation;

Check warning on line 277 in src/CommunityToolkit.Maui.Camera/CameraManager.macios.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 277 in src/CommunityToolkit.Maui.Camera/CameraManager.macios.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (macos-15)

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 277 in src/CommunityToolkit.Maui.Camera/CameraManager.macios.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (windows-latest)

This call site is reachable on: 'iOS' 15.0 and later, 'maccatalyst' 15.0 and later. 'UIApplication.StatusBarOrientation' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

return interfaceOrientation switch
{
Expand Down Expand Up @@ -346,7 +350,7 @@
{
if (PreviewLayer.Connection is not null)
{
PreviewLayer.Connection.VideoOrientation = videoOrientation;

Check warning on line 353 in src/CommunityToolkit.Maui.Camera/CameraManager.macios.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'MacCatalyst' 15.0 and later. 'AVCaptureConnection.VideoOrientation' is obsoleted on: 'maccatalyst' 17.0 and later (Use VideoRotationAngle instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)

Check warning on line 353 in src/CommunityToolkit.Maui.Camera/CameraManager.macios.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (windows-latest)

This call site is reachable on: 'iOS' 15.0 and later, 'maccatalyst' 15.0 and later. 'AVCaptureConnection.VideoOrientation' is obsoleted on: 'ios' 17.0 and later (Use VideoRotationAngle instead.), 'maccatalyst' 17.0 and later (Use VideoRotationAngle instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/CommunityToolkit.Maui.Camera/CameraManager.net.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ partial class CameraManager

public partial ValueTask UpdateCaptureResolution(Size resolution, CancellationToken token) => throw new NotSupportedException(notSupportedMessage);

protected virtual partial Task PlatformStartVideoRecording(Stream stream, CancellationToken token) => throw new NotSupportedException(notSupportedMessage);
protected virtual partial Task PlatformStopVideoRecording(CancellationToken token) => throw new NotSupportedException(notSupportedMessage);
protected virtual partial Task PlatformStartCameraPreview(CancellationToken token) => throw new NotSupportedException(notSupportedMessage);

protected virtual partial void PlatformStopCameraPreview() => throw new NotSupportedException(notSupportedMessage);
Expand Down
17 changes: 17 additions & 0 deletions src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
/// <exception cref="NullReferenceException">Thrown when no <see cref="CameraProvider"/> can be resolved.</exception>
/// <exception cref="InvalidOperationException">Thrown when there are no cameras available.</exception>
partial class CameraManager(
IMauiContext mauiContext,

Check warning on line 16 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

Parameter 'mauiContext' is unread.

Check warning on line 16 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

Parameter 'mauiContext' is unread.

Check warning on line 16 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

Parameter 'mauiContext' is unread.

Check warning on line 16 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

Parameter 'mauiContext' is unread.

Check warning on line 16 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

Parameter 'mauiContext' is unread.

Check warning on line 16 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (macos-15)

Parameter 'mauiContext' is unread.

Check warning on line 16 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (windows-latest)

Parameter 'mauiContext' is unread.

Check warning on line 16 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (windows-latest)

Parameter 'mauiContext' is unread.

Check warning on line 16 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (macos-15)

Parameter 'mauiContext' is unread.
ICameraView cameraView,

Check warning on line 17 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

Parameter 'cameraView' is unread.

Check warning on line 17 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

Parameter 'cameraView' is unread.

Check warning on line 17 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

Parameter 'cameraView' is unread.

Check warning on line 17 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (windows-latest)

Parameter 'cameraView' is unread.

Check warning on line 17 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (macos-15)

Parameter 'cameraView' is unread.
ICameraProvider cameraProvider,

Check warning on line 18 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

Parameter 'cameraProvider' is unread.

Check warning on line 18 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

Parameter 'cameraProvider' is unread.

Check warning on line 18 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

Parameter 'cameraProvider' is unread.

Check warning on line 18 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (windows-latest)

Parameter 'cameraProvider' is unread.

Check warning on line 18 in src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (macos-15)

Parameter 'cameraProvider' is unread.
Action onLoaded) : IDisposable
{
internal Action OnLoaded { get; } = onLoaded;
Expand Down Expand Up @@ -52,6 +52,19 @@
/// <returns>A <see cref="ValueTask"/> that can be awaited.</returns>
public Task StartCameraPreview(CancellationToken token) => PlatformStartCameraPreview(token);

/// <summary>
/// Starts the video recording.
/// </summary>
/// <returns>A <see cref="ValueTask"/> that can be awaited.</returns>
public Task StartVideoRecording(Stream stream, CancellationToken token) => PlatformStartVideoRecording(stream, token);


/// <summary>
/// Starts the video recording.
/// </summary>
/// <returns>A <see cref="ValueTask"/> that can be awaited.</returns>
public Task StopVideoRecording(CancellationToken token) => PlatformStopVideoRecording(token);

/// <summary>
/// Stops the camera preview.
/// </summary>
Expand Down Expand Up @@ -131,4 +144,8 @@
/// Stops the preview from the camera, at the platform-specific level.
/// </summary>
protected virtual partial void PlatformStopCameraPreview();

protected virtual partial Task PlatformStartVideoRecording(Stream stream, CancellationToken token);

protected virtual partial Task PlatformStopVideoRecording(CancellationToken token);
}
3 changes: 3 additions & 0 deletions src/CommunityToolkit.Maui.Camera/CameraManager.tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ partial class CameraManager
protected virtual partial void PlatformDisconnect() => throw new NotSupportedException(notSupportedMessage);

protected virtual partial ValueTask PlatformTakePicture(CancellationToken token) => throw new NotSupportedException(notSupportedMessage);
protected virtual partial Task PlatformStartVideoRecording(Stream stream, CancellationToken token) => throw new NotSupportedException(notSupportedMessage);
protected virtual partial Task PlatformStopVideoRecording(CancellationToken token) => throw new NotSupportedException(notSupportedMessage);

}
45 changes: 44 additions & 1 deletion src/CommunityToolkit.Maui.Camera/CameraManager.windows.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Runtime.Versioning;
using System;
using System.Runtime.Versioning;
using CommunityToolkit.Maui.Extensions;
using Microsoft.UI.Xaml.Controls;
using Windows.Media.Capture;
Expand All @@ -14,6 +15,7 @@ partial class CameraManager
MediaPlayerElement? mediaElement;
MediaCapture? mediaCapture;
MediaFrameSource? frameSource;
LowLagMediaRecording? mediaRecording;

public MediaPlayerElement CreatePlatformView()
{
Expand Down Expand Up @@ -202,4 +204,45 @@ protected async Task PlatformUpdateResolution(Size resolution, CancellationToken
await mediaCapture.VideoDeviceController.SetMediaStreamPropertiesAsync(MediaStreamType.Photo, filteredPropertiesList.First()).AsTask(token);
}
}

protected virtual async partial Task PlatformStartVideoRecording(Stream stream, CancellationToken token)
{
if (!IsInitialized || mediaCapture is null || mediaElement is null)
{
return;
}

MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto);
mediaRecording = await mediaCapture.PrepareLowLagRecordToStreamAsync(profile, stream.AsRandomAccessStream());

frameSource = mediaCapture.FrameSources.FirstOrDefault(source =>
source.Value.Info.MediaStreamType == MediaStreamType.VideoRecord
&& source.Value.Info.SourceKind == MediaFrameSourceKind.Color).Value;
if (frameSource != null)
{
var frameFormat = frameSource.SupportedFormats
.OrderByDescending(f => f.VideoFormat.Width * f.VideoFormat.Height).FirstOrDefault();

if (frameFormat != null)
{
await frameSource.SetFormatAsync(frameFormat);
mediaElement.AutoPlay = true;
mediaElement.Source = MediaSource.CreateFromMediaFrameSource(frameSource);
await mediaRecording.StartAsync();
}
}
}

protected virtual async partial Task PlatformStopVideoRecording(CancellationToken token)
{
if (!IsInitialized || mediaElement is null)
{
return;
}

if (mediaRecording != null)
{
await mediaRecording.StopAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,30 @@
internal static Command<CancellationToken> CreateCaptureImageCommand(BindableObject bindable)
{
var cameraView = (CameraView)bindable;
return new(async token => await cameraView.CaptureImage(token).ConfigureAwait(false));

Check warning on line 50 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.CaptureImage(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 50 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.CaptureImage(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 50 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.CaptureImage(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 50 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.CaptureImage(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 50 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.CaptureImage(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 50 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.CaptureImage(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 50 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.CaptureImage(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 50 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.CaptureImage(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
}

internal static Command<CancellationToken> CreateStartCameraPreviewCommand(BindableObject bindable)
{
var cameraView = (CameraView)bindable;
return new(async token => await cameraView.StartCameraPreview(token).ConfigureAwait(false));

Check warning on line 56 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartCameraPreview(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 56 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartCameraPreview(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 56 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartCameraPreview(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 56 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartCameraPreview(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 56 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartCameraPreview(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 56 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartCameraPreview(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 56 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartCameraPreview(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 56 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartCameraPreview(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
}

internal static ICommand CreateStopCameraPreviewCommand(BindableObject bindable)
{
var cameraView = (CameraView)bindable;
return new Command(_ => cameraView.StopCameraPreview());

Check warning on line 62 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopCameraPreview()' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 62 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopCameraPreview()' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 62 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopCameraPreview()' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 62 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopCameraPreview()' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 62 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopCameraPreview()' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 62 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopCameraPreview()' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 62 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopCameraPreview()' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 62 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopCameraPreview()' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
}

internal static Command<Stream> CreateStartVideoRecordingCommand(BindableObject bindable)
{
var cameraView = (CameraView)bindable;
return new(async stream => await cameraView.StartVideoRecording(stream, CancellationToken.None).ConfigureAwait(false));

Check warning on line 68 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartVideoRecording(Stream, CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 68 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartVideoRecording(Stream, CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 68 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartVideoRecording(Stream, CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 68 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartVideoRecording(Stream, CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 68 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartVideoRecording(Stream, CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 68 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StartVideoRecording(Stream, CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
}

internal static ICommand CreateStopVideoRecordingCommand(BindableObject bindable)
{
var cameraView = (CameraView)bindable;
return new Command(_ => cameraView.StopVideoRecording(CancellationToken.None));

Check warning on line 74 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopVideoRecording(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 74 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Library (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopVideoRecording(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 74 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopVideoRecording(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 74 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopVideoRecording(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 74 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Build Sample App using Latest .NET SDK (windows-latest)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopVideoRecording(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 74 in src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs

View workflow job for this annotation

GitHub Actions / Run Benchmarks (macos-15)

This call site is reachable on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'tizen', 'windows' 10.0.10240.0 and later. 'CameraView.StopVideoRecording(CancellationToken)' is only supported on: 'android' 21.0 and later, 'ios', 'maccatalyst', 'windows' 10.0.10240.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
}
}
Loading
Loading