Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Conversation

@kavitamp
Copy link
Contributor

@kavitamp kavitamp commented Oct 18, 2022

Issue:

When OnlyVideo is enabled the camera icon opens in the camera mode instead of the video mode

Description and steps:

When OnlyVideo is enabled and the user clicks on the camera icon, it opens the camera instead of the video.
Steps:

  1. Enable "Only Video" mode
  2. Click on any video picker functionality
  3. Click on the camera icon
  4. The picture mode is displayed instead of the video mode

Expected behavior:

When OnlyVideo is enabled and the user clicks on the camera icon, it opens the camera instead of the video.

Issue recording:

OnlyVideo-Issue.mp4

Fixed issue recording:

OnlyVideo-Fix.mp4

Please let me know if you have any feedback.
Thank you!

Close #260

@kavitamp kavitamp changed the title Start video recording on camera icon clicked when "OnlyVideo" is enabled Enhancement: Start video recording on camera icon clicked when "OnlyVideo" is enabled Oct 18, 2022
@esafirm
Copy link
Owner

esafirm commented Oct 23, 2022

Nice addition @kavitamp , as a matter of fact, we had an iteration about this from a year back in here #322

The changes on that PR are already good IMO, but it containing conflicts. So maybe you could take a look and apply the changes to this PR instead? Thanks

@kavitamp
Copy link
Contributor Author

kavitamp commented Oct 25, 2022

So maybe you could take a look and apply the changes to this PR instead?

@esafirm, so basically you want me to update the remaining changes of #322 PR in mine, including video icons, etc?

@kavitamp
Copy link
Contributor Author

@esafirm I have updated the code and have added a video icon in the menu bar, please take a look

Copy link
Owner

@esafirm esafirm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, overall it's looking good. Need some small changes here and there 😄

Oh and don't forget to rebase as we fix the CI and upgrade the AGP and Kotlin version.

@kavitamp
Copy link
Contributor Author

@esafirm,
I have fixed comments, please take a look.

@esafirm
Copy link
Owner

esafirm commented Nov 20, 2022

Cool @kavitamp just testing the feature in an emulator, but it seems there's an error with the Camera app in it

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.content.ContentValues.put(java.lang.String, java.lang.Long)' on a null object reference
                                                                                                    	at com.android.camera.VideoModule.saveVideo(VideoModule.java:1263)
                                                                                                    	at com.android.camera.VideoModule.stopVideoRecording(VideoModule.java:1513)
                                                                                                    	at com.android.camera.VideoModule.onStopVideoRecording(VideoModule.java:656)
                                                                                                    	at com.android.camera.VideoModule.onShutterButtonClick(VideoModule.java:697)
                                                                                                    	at com.android.camera.ShutterButton.performClick(ShutterButton.java:190)
                                                                                                    	at android.view.View.performClickInternal(View.java:7483)
                                                                                                    	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
                                                                                                    	at android.view.View$PerformClick.run(View.java:29334)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:942)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:201)
                                                                                                    	at android.os.Looper.loop(Looper.java:288)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:7872)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Will check in the real device later

@esafirm
Copy link
Owner

esafirm commented Nov 20, 2022

@kavitamp anyway, it would be great if you can provide an instrumentation test for this as well. Thanks

@mohamedagamy
Copy link

mohamedagamy commented Sep 29, 2023

please upgrade gradle and remove kotlin extensions. @kavitamp.
please approve this pull request @esafirm.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is there any way by which I can capture multiple images from camera without deleting the previous images/videos and can I record a video too?

3 participants