Questions and discussions about using the Shopify CLI and Shopify-built libraries.
I am attempting to use camera to take product images to build products, but when my code does this:
navigator.mediaDevices.getUserMedia({ video: true })
it just causes an error "permission denied". I have no problem with the browser asking the user for this permission, but it just fails ... no request is issued to user.
Any ideas? Thanks ,jb
Solved! Go to the solution
This is an accepted solution.
I have learned some about this ... It looks to me as if the admin document is loaded into an iFrame, and the headers need to be set so that camera access is allowed from the iFrame.
Some excerpts from official Mozilla pages:
navigator.permissions.query({ name: "camera" }).then((b) => console.log(b.state))
----------
This is an accepted solution.
I have learned some about this ... It looks to me as if the admin document is loaded into an iFrame, and the headers need to be set so that camera access is allowed from the iFrame.
Some excerpts from official Mozilla pages:
navigator.permissions.query({ name: "camera" }).then((b) => console.log(b.state))
----------
Did you manage to find a solution here? I'm also stuck on the same issue.
Yeah, I'm afraid I did. It's impossible by design. I gave up, switched to Plan B (actually it was more like Plan M) and used a camera app to save images as files on my local machine, then pull those files into the Shopify Admin code. Does that make sense? Cheers jb
That's a wonderful workaround! Sadly, not for me I guess, Since I need audio permission for audio streaming.
Hi! I have a very similar requirement for my app. Did you ever find a solution/workaround for mic access?
Yeah, I'm afraid I did. It's impossible by design. See my comment above of Feb 8.
Hey if anyone needs help with this. I left a comment on this post here