mit-cml / appinventor-sources

MIT App Inventor Public Open Source
http://appinventor.mit.edu/appinventor-sources/
Apache License 2.0
1.46k stars 2.04k forks source link

Add UsesCamera property to WebViewer #2090

Open ewpatton opened 4 years ago

ewpatton commented 4 years ago

Describe the desired feature

With more people building models with tools like Teachable Machine and wanting to embed them in a webviewer, they need the WebViewer to ask for camera permissions. In our extensions we do this implicitly, but it won't always be the case that people will run these models through an extension. We should add a property to the WebViewer called UsesCamera that works like the UsesLocation property and allows the WebViewer to ask for Camera permission and include the appropriate permission in the manifest.

Give an example of how this feature would be used

If someone wants to embed an example of teachable machine in an app (without using an extension).

Why doesn't the current App Inventor system address this use case?

The WebViewer does not ask for camera permissions so it is not possible at this time.

Why is this feature beneficial to App Inventor's educational mission?

Teachers and students interested in exploring teachable machine or other ML models cannot use them with the WebViewer as designed.

elatoskinas commented 4 years ago

I can look into this issue.

I figure we should have a project-wide setting in the browser that keeps track of this functionality, and then adds the required permission(s) for Android based on this setting, much like the Location permission does, or would this be somehow different?