I have an HTML5 video tag with the attributes autoplay loop muted playsinline
. In iOS the video stops playing, if the user switches to another browser tab. However it doesn't start again when switching back.
I tried listening for different events such as window.onfocus()
and then manually starting the video with the play()
method, however these events do not seem to fire, until the user actually clicks inside the document again, and so they are virtually useless in this case.
This site has an HTML5 video tag in the hero: https://www.stoxenergy.com/en/technology/
However that one keeps playing, even when the user switches tabs.
I can't figure out how they do it. Any ideas?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…