Is it possible to make laptop camera available to app running in "clickable desktop"
-
I made an HTML+JS app that tries to access device camera. I'm trying to test this app using "clickable desktop" command. But it seems the clickable's container environment is not able to detect my laptop camera/mic etc when I query for media devices using javascript
navigator.mediaDevices.getUserMedia()
. Is it possible to test camera access in clickable desktop environment? -
@arubislander From my reading of the documentations I couldn't figure out any formal way to configure the Multimedia support in "docker run" command but I did something hackish and got camera working in clickable desktop. Audio devices were already accessible in the docker.
Under by Home directory I found the place where the clickable python scripts are installed.
In there I searched further and found the script "commands/docker/multimedia_support.py"
Here I found the audio device(dev/snd) was already being made accessible to the docker container through the config hard coded here.
So I edited the code in this file, to pass my camera devices also in the key-value list passed into docker_config.volumes.update method.
Then I re-run my app and Voila! camera access started working in my app.
From clickable.log I could see the key-value pairs passed in here are coming out in thedocker run
command executed while launching app as volumes to be mounted(-v arguments).
Thanks for your support. -
@rineez Unfortunately this is not yet possible. Clickable desktop runs your app in a docker container. To achieve what you are looking for work would need to be done in configuring the container to make the camera available from the container as a first step. If after that things would 'just work', would still remain to be seen.
-
@arubislander Thanks for the direction. Is there some way to customize the docker run command used by clickable to start the underlying container?
I have seen some other docker related post that suggest --device= parameter can be passed to "docker run" command to map a device of the host into the container.
For example, this SO thread https://stackoverflow.com/questions/34302096/sharing-devices-webcam-usb-drives-etc-with-docker -
@rineez I didn't come across any such option. But check the clickable documentation, maybe I missed something.
-
@arubislander From my reading of the documentations I couldn't figure out any formal way to configure the Multimedia support in "docker run" command but I did something hackish and got camera working in clickable desktop. Audio devices were already accessible in the docker.
Under by Home directory I found the place where the clickable python scripts are installed.
In there I searched further and found the script "commands/docker/multimedia_support.py"
Here I found the audio device(dev/snd) was already being made accessible to the docker container through the config hard coded here.
So I edited the code in this file, to pass my camera devices also in the key-value list passed into docker_config.volumes.update method.
Then I re-run my app and Voila! camera access started working in my app.
From clickable.log I could see the key-value pairs passed in here are coming out in thedocker run
command executed while launching app as volumes to be mounted(-v arguments).
Thanks for your support. -
@rineez That is great news. Well done!
Please consider submitting your changes as a PR to the Clickable repository if they are not specific to your development environment setup
-
-
@arubislander I'm not sure. I suspect the name of video device can change for different environments. Some environments may not even have a camera, and I haven't yet tested for negative side effects of putting a non-existing device there.
I'm thinking I may have to write some additional code to detect camera devices in the environment to make it into a PR suitable for all users. I'll try to figure out though.Thanks for the encouragement
-
This post is deleted!