I am using an iframe to display a video at an external URL.
<iframe id="iframe_id" src="{url}" allow="autoplay" frameborder="0"></iframe>
The video should autoplay, but sometimes it is blocked by Chrome due to the browser's autoplau policy.
My question is how to detect whether it is playing or has been blocked by the browser using JS?
I need something like iframe.isPlaying shown below:
let iframe = document.getElementById("iframe_id");
if (iframe.isPlaying) {
...
}
Not sure if something like that exists in iframe.
Thanks in advance!