3 ms·
> The solution I use is to set media.autoplay.blocking_policy to 2 in about:config (I found this on the Mozilla wiki [1]). This setting requires a click to play
by gruez 5y ago
> The solution I use is to set media.autoplay.blocking_policy to 2 in about:config (I found this on the Mozilla wiki [1]). This setting requires a click to play media.
Not really. The mozilla wiki says:
>The technical detail for this policy is that the play invocation should be triggered inside an user input event handler.
If the autoplay is what OP described (ie. "starting to auto-play just by scrolling into view"), then that would satisfy the condition because it's within an user input event handler (the scroll).
- zwegner 5y agoRight, and as the wiki mentions, it's not a great solution overall. But at least it works for me for Twitter (and Twitter is still trying to autoplay on scroll, the play button on videos disappear while scrolling only to reappear). Not sure why it works actually, but it's better than going in the Twitter settings all the time or dealing with autoplay.
- opheliate 5y agoFrom the wiki: > For example, when a user clicks the element X, then we only allow a website to start the element X from a function that is in the call stack based on the X's “click” event handler. I could be misinterpreting this, but doesn't that imply that scrolling into view would generally not be sufficient to allow autoplay? Since the scroll event would be on the body/window, and the video itself is not the target of the event?
- gruez 5y agoMy interpretation there is that you can start video playback within a click handler or one of its callees, but there's no check on where the video element is. The latter check would be impossible to implement because <video> elements can't have child elements (eg. for playback buttons) so adding that restriction would break custom playback buttons.