streamlit-audio-recorder icon indicating copy to clipboard operation
streamlit-audio-recorder copied to clipboard

Get "Component Error: Cannot read properties of null (reading 'getAudioTracks')" when run remotely

Open sanzgiri opened this issue 1 year ago • 6 comments

My streamlit app using this component runs fine locally on my Mac but when I run the same app on an Ubuntu VM in the cloud (Azure), it does not work.

When I start the recording, I don't see the waveform, so no recording may be taking place. And when I click stop, I get this error: "Component Error: Cannot read properties of null (reading 'getAudioTracks')"

sanzgiri avatar Mar 02 '23 08:03 sanzgiri

I think the problem is giving access to the remote site to use the microphone via the browser's security settings. With Chrome or Edge, you can only do this if the remote site uses https. And streamlit runs over http by default and that is how it is running on my remote host. I have not seen a simple way to run streamlit over https.

sanzgiri avatar Mar 02 '23 15:03 sanzgiri

I also getting the same error "Component Error: Cannot read properties of null (reading 'getAudioTracks')" when i run the app as web application using ngrok in windows. But it is working fine locally. Even i given access to microphone in my chrome browser. Is there any solution ?

DharmarajaP avatar Mar 04 '23 05:03 DharmarajaP

I was able to run streamlit over https, after obtaining certificates from Let's Encrypt using certbot and using the instructions here: https://docs.streamlit.io/library/advanced-features/https-support

sanzgiri avatar Jun 20 '23 21:06 sanzgiri

I was able to run streamlit over https, after obtaining certificates from Let's Encrypt using certbot and using the instructions here: https://docs.streamlit.io/library/advanced-features/https-support

Can you tell me the details of how to make it work? I also stucked by this remote macrophone problem. Thank you.

wuyu9603 avatar Jul 27 '23 06:07 wuyu9603

I was able to run streamlit over https, after obtaining certificates from Let's Encrypt using certbot and using the instructions here: https://docs.streamlit.io/library/advanced-features/https-support

Can you tell me the details of how to make it work? I also stucked by this remote macrophone problem. Thank you.

Just solved this problem. 1.Generate temporary SSL authentication openssl genrsa 2048 > host.key chmod 400 host.key openssl req -new -x509 -nodes -sha256 -days 365 -key host.key -out host.cert 2.streamlit run with https streamlit run xx.py --server.sslCertFile host.cert --server.sslKeyFile=host.key

JDanielWu avatar Dec 12 '23 06:12 JDanielWu

在使用 certbotLet's Encrypt 获取证书并使用此处的说明后,我能够通过 https 运行 streamlit:https://docs.streamlit.io/library/advanced-features/https-support

你能告诉我如何让它工作的细节吗?我也被这个远程宏电话问题卡住了。谢谢。

刚刚解决了这个问题。 1.生成临时SSL身份验证 openssl genrsa 2048 > host.key chmod 400 host.key openssl req -new -x509 -nodes -sha256 -days 365 -key host.key -out host.cert 2.streamlit run with https streamlit run xx.py --server.sslCertFile host.cert --server.sslKeyFile=host.key

What's the difference between this and reverse proxy https, I use reverse proxy https and it works sometimes, but it's very unstable.

jamiesun avatar Jan 12 '24 03:01 jamiesun