Sharing blocks custom webcam component due to featurePolicy

Hi everybody,

My app is deployed on Streamlit sharing: https://share.streamlit.io/patryk-oleniuk/face-emotionz-webapp/dev/app/streamlit_app.py

Code (still working on it): GitHub - patryk-oleniuk/face-emotionz-webapp: Streamlit web-app using OpenCV to recognize faces in a photo and my custom tensorflow DNN to recognize emotions in those faces.

If you select “Image source” “Webcam”, its gonna use this component to get a picture from a webcam:
https://github.com/tconkling/streamlit-webcam

That webcam component works perfectly on my localhost, but on streamlit sharing I get an error message
Webcam error: Error: 'camera' is not in our featurePolicy

Localhost:

Streamlit sharing:

Edit: I read more online and I think it’s aboit the iframe’s HTTP featurePolicy header:
https://developers.google.com/web/updates/2018/06/feature-policy

Thanks for any tips, cheers!

Hey @patryk-oleniuk, welcome to Streamlit, and thanks for the heads up!

Yeah, this is an oversight on our part. Streamlit sharing mounts your Streamlit app in an iframe, and that iframe currently doesn’t have the same featurePolicy that Streamlit Component iframes have. We’ll have a fix for this soon!

2 Likes

Thanks @tim, I see!

When is the fix expected, few days, weeks or months? Just trying to understand, thanks in advance :slight_smile:

My understanding is it should be on the order of days - hopefully this week or next. (It should go out in an upcoming Streamlit sharing release, unless something unusual happens!)

2 Likes