Ivo/switch camera#249
Conversation
|
In this PR:
|
| function RemoteKeyboard (commandHandler) { | ||
| const pressedKeys = new Set() | ||
|
|
||
| // This deconstruction does not work. The functions are not called. Why? |
There was a problem hiding this comment.
What is this supposed to do?
There was a problem hiding this comment.
This is not really critical, but in JS it is common to assign object properties to local variables, like this:
const {reset, goForward, goBackward, forwardLeft, forwardRight...} = commandHandler
is equivalent to:
const reset = commandHandler.reset
So, instead of calling:commandHandler.reset()we can just call:reset()
But in this case, if we call reset(), the function is not called. I was wondering why, because functions are first-class citizens in JS, and should be able to use them just like any other property. Maybe somebody can answer.
There was a problem hiding this comment.
|
I noticed that it does not only toggle between front and back but actually goes through all cameras available on the phone. For example on the Huawei P30 Pro there are 4 cameras: back (ultrawide, normal, zoom), front (wide). Pressing the flip camera button toggles through these 4 options. It is actually nice to be able to pick any camera on the bot phone. But it is not really expected. |
|
Interesting... |
Actually, after running through the debugger, camera names are just "0", "1" ... So we do not know if they are front, back. macro, etc. They just select them in sequence. So I don't think we can chose specific camera, since we don't know what it is. |
|
Should be possible to find out if it is front or rear camera. But I think it is also a nice feature to be able to toggle between the rear cameras. For driving it is good to use the ultra-wide camera. I guess the coolest would be if phone reports the available cameras and user can choose one. But maybe that is overkill. We could also merge now and look into this in a separate PR if you are interested to look into it. |
|
Sounds good.
Ivo
…On Wed, Jan 12, 2022, 12:07 PM thias15 ***@***.***> wrote:
Should be possible to find out if it is front or rear camera.
https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#LENS_FACING
But I think it is also a nice feature to be able to toggle between the
rear cameras. For driving it is good to use the ultra-wide camera. I guess
the coolest would be if phone reports the available cameras and user can
choose one. But maybe that is overkill. We could also merge now and look
into this in a separate PR if you are interested to look into it.
—
Reply to this email directly, view it on GitHub
<#249 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7M37XPGGGSCESUA6RN4TTUVWYODANCNFSM5LQZKTVQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Ivo/switch camera
No description provided.