How to detect when autoplay is blocked?

556 Views Asked by At

Currently WebRTC fails on Brave browser with "Autoplay was blocked on this page" error.

This error is not particularly visible:

enter image description here

You can test it with Brave browser where any WebRTC is enabled, e.g. https://test.webrtc.org/.

My app users are reporting this as a bug – since their experience is that the video is just not loading.

What is the proper way to handle this?

1

There are 1 best solutions below

0
On

https://webrtchacks.com/autoplay-restrictions-and-webrtc/ has quite some (still valid) suggestions. Checking the audiocontexts state as suggested here (linked from a comment) is probably the way to go.

It is rather surprising that brave does this, chrome does allow autoplay when getUserMedia is active.