Skip to content
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

Enhancement: Start video recording on camera icon clicked when "OnlyVideo" is enabled #411

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants