-
Notifications
You must be signed in to change notification settings - Fork 460
Camera Video Recording #2710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Camera Video Recording #2710
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VladislavAntonyuk I believe you're using the old Camera2 APi, you should use the CameraX API instead, it will be simpler and it's newer
here for reference https://developer.android.com/media/camera/camerax/video-capture
I see we reference a NuGet for camera 2, that is why I used this implementation. According to Google camera 2 is not obsolete, but allows you to have a full control of the camera. CameraX just a convenient way to work with camera api. I will update to CameraX. |
Ensures proper handling of the video recording stream by setting appropriate file access and share options. Also, explicitly flushes the stream and nullifies the file after copying to prevent potential issues with file access or deletion. Addresses an issue where the `VideoRecordEvent` was not correctly identified as the final event.
Updates the `PlatformStartVideoRecording` method signature on Tizen to accept a stream, allowing for greater flexibility in handling video data.
Updated CameraViewPage.xaml to include buttons for starting/stopping video recording and setting night mode. Changed "GetStream" button text to "Save Video Recording" and repositioned "Capture Image" button. Simplified video file creation in CameraManager.android.cs by removing unnecessary ContentValues. Modified PlatformStopVideoRecording to change flow after stopping video recording. Enhanced CreateStopVideoRecordingCommand to use async lambda for better asynchronous operation handling.
…ommunityToolkit/Maui into feature/camera-video-recording
src/CommunityToolkit.Maui.Camera/Primitives/CameraViewDefaults.shared.cs
Show resolved
Hide resolved
This is looking very well done! I am shocked at how nice some of the code looks. I have for over a year now wanted a solution to async - await for android in dotnet. From looking at this code I can see an easy example I can reference in the future for how to do that! Ty for that alone! I am going to test on my Mac mini and my iPad later this morning but just looking at the code it looks good to go after you look at my comments. I think all that is left for now is finishing testing and starting the documentation. This is a great addition to the toolkit. |
Start video recording on iOS and iOS simulator is crashing on button click with message about not finding camera.
|
Managed to get a stacktrace for MacOS. For some reason the debugger was not working for either iOS simulator or device. MacOS:
Hopefully that might help figure out what is going on. I don't have a camera attached to my mac mini. Which is probably an issue but should the sample app crash when you open the camera page? It just CTD when I navigate to camera page. |
The camera is not available on iOS simulators; you can only test it on real devices |
Refactor video recording logic and improve null checks - Updated `StartUseCase` in `CameraManager.android.cs` to use a builder pattern for `videoRecorder`, allowing for null checks on `Quality.Highest`. - Changed executor retrieval in `PlatformStartVideoRecording` to enhance readability and error handling. - Improved null safety in `EnableModes` by checking for nullability of `extensionsManager`. - Updated `SupportedOSPlatform` in `CameraManager.windows.cs` to require a higher minimum Windows version. - Refactored `PlatformStartVideoRecording` to use `var` for `profile` and modernized null-checking style for `frameSource` and `frameFormat`.
is there anything blocking this change? |
Hey @TheCodeTraveler, thank you for the code review. Why did you change StartVideoRecording method to return the stream? |
namespace CommunityToolkit.Maui.Core; | ||
|
||
[SupportedOSPlatform("windows10.0.10240.0")] | ||
[SupportedOSPlatform("windows10.0.16299.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should bump the .net9.0-windows version in CommunityToolkit.Maui.Camera.csproj
, right?
$(NetVersion)-windows10.0.16299.0
This is basically saying that CameraView
only works on Windows v10.0.16299.0+ since it requires CameraManager
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have version 19041; we probably can remove the attribute altogether.
This reverts commit 6be4152.
Updates the camera permission request to also request microphone permissions. This ensures that the application has the necessary permissions to record audio when capturing video.
Description of Change
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information
https://vladislavantonyuk.github.io/articles/Turn-any-phone-into-an-IP-Camera-in-30-Minutes-using-.NET-MAUI/