Having some video on the random website is not something anyone would prefer. However, browsers are most often have auto play media on by default. Chrome and Firefox, two of the most used browser have this feature enabled by default. So this is how you disable them unless you interact with it.
This happened to me when I had youtube tab open when closing the browser and I had set the browser to retain the tabs on next restart. Next time you restart the browser, Firefox lagged and was just playing the youtube video. Needless to say, that is not a necessary behavior.
There are mostly two kinds of media widespread on the web; Flash and HTML5. While flash is set to demise, there are still many sites that offer content through flash. Most popular video site like YouTube and Vimeo have incorporated HTML5 video standards to offer videos to its users.
For flash, it is easy as choosing an option on the browser. As flash operates as an extension on browsers like Chrome and Firefox, you can easily disable them.
Disable autoplay media in Firefox:
- Go to the Extension page (Ctrl+Shift+A).
- On the Plugins tab, Choose the flash plugin to “Ask to Activate“
This makes any flash content wait for you to interact with it before it auto loads content, game or media. Once it is set to “Ask to Activate” if you encounter a site which requires flash to run and you have no options, you can click to activate the flash media.
A warning dialogue will appear to confirm your consent. You can also make Firefox remember the setting for the specific site.
For other media like HTML5, audio, and video you will have to go through Firefox’s configuration page to stop them from auto-playing.
- Type about:config on the navigation bar.
- Accept the warning.
- Search for “media.autoplay.enabled” in the search bar inside.
- Set media.autoplay.enabled to false
Disable autoplay media in Chrome:
- Go to chrome://settings/content
- Find Flash setting row
- Disable Flash from loading entirely (You can still enable flash content)
After doing this, if you explicitly need to enable flash on some site you will be greeted with an overlay that offers you to enable flash content. You can right click on it and enable flash for the specific content only.
For other media content:
- Go to chrome://flags/#autoplay-policy
- Set the setting to “Document user activation is required”
This configuration makes media content load but not play automatically. You will need to press the play button manually to start playing videos.
You will no longer be bothered by autoplaying media sites after setting these configuration on the respective browser. The web browsing experience will be faster and smoother. Without the browser dealing with autoplaying media, it can load pages faster.