I am not sure who thought, that autoplay on music and videos is a good idea in a browser. Using my tablet on travel, it is just a joy to click on a link and some video starts entertaining everyone else but me. Firefox offers some toggles in the regular settings to deactivate autoplay, however I found, that it does not stop videos from playing in certain situations.

So what is the solution

Open a page with about:config and set the following settings:

Setting Value
media.autoplay.allow-extension-background-pages false
media.autoplay.block-event.enabled true
media.autoplay.blocking_policy 2
media.autoplay.default 5

This works for me in Firefox / Librefox and Firefox Mobile (nightly)