How can I enable autoplay in Chrome? - google-chrome

I am making a Chrome Extension and "autoplay" is essential to it.
The extension is a kind of audio player. It lets me add sites to a playlist and the extension will automatically go to each of those URLs and play their content in order.
Since the program needs to go from one element in the playlist to the next seamlessly, I can't require user interaction.
I wanted to enable autoplay in MY OWN browser so that I could at least use the software personally, but I can't even figure out how to do that.
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
On that link it says to go to chrome://flags/#autoplay-policy but this flag doesn't seem to exist.
Chrome Version 78.0.3904.108 (Official Build) (64-bit)
Note
I found a workaround, which is keep the actual audio player page alive and load the other pages in an iframe. This only works because they don't enforce same-origin policy. However I'm still curious if there's a way to disable the whole autoplay restriction.

It's possible to start Chrome with a flag that turns off the autoplay policy. Unfortunately this can only be done via the command line. At least as far as I know.
On macOS it looks like this:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --autoplay-policy=no-user-gesture-required
It's a bit different for other operating systems. But there is an official guide which explains how to start Chromium (or Chrome) from the command line on Windows or Linux.
The setting will not persist. The next time you start Chrome without that flag it will have the autoplay policy enabled again.

Related

Make Audio Autoplay on Chrome / Edge / CefSharp or Firefox

My question is similar to this one:
How to make audio autoplay on chrome
...although most of the answers on that fail today or rely on tricks that will inevitably be fixed in the future. However, in my scenario, I have an additional advantage - I only need this to work on one specific machine on a specific page (just an auto-refreshing dashboard page), so I'm open to command line parameters or even other browsers that might allow me to override autoplay policies.
There's also this answer:
Chrome Autoplay Policy - Chrome 76
...and someone suggested this:
google-chrome-stable --kiosk http://google.com/ --new-window --start-maximized --incognito --autoplay-policy=no-user-gesture-required --disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies &
...however that doesn't seem to work anymore (I adjusted the initial command from "google-chrome-stable" to the "chrome.exe" executable on my test machine). The desired page loads up just fine but it doesn't autoplay the audio until I interact with it (e.g. manually refresh the page) to provide that user gesture. Once I provide a user gesture, audio autoplays fine.
I'm even open to building a simple custom C# browser app with CefSharp (I have a couple of those already), but none of the suggested solutions work with that, either. It seems like everything I find is referencing an older version.
Any suggestions for this situation in 2021 which isn't something that could be seen as an exploitable workaround (e.g. Javascript triggering a click) that would probably be fixed in a near future build of browsers?
The command line does not work because the statement that should allow the sound to play
--autoplay-policy=no-user-gesture-required
is cancelled by the
--disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies
which is equivalent to "autoplay is never allowed".
Full details can be found in the 'Developer Switches' from the Chrome documentation (https://developer.chrome.com/blog/autoplay/).

Youtube does not work on any browser. Chrome, Mozilla, Edge, IE

One day youtube stopped working on all browsers. It loads preview of the video and then loading infinite circle appears. Sometimes it shows the message: if playback doesn't begin shortly, try restarting your device. I cleared coockies, history etc. two times. I found something about the hosts file, but the original file contains the same exact thing the guide was recommending to replace. There similar problems with youtube, but i didn't find anything that could possibly solve the issue except the host file.
Whether the problem only occurs on the YouTube site? Try to play some online video from another site, such as Bing and Google.
If this issue only occurs on the YouTube site, perhaps the issue is related the YouTube site, you could check the YouTube help forum and contact with them.
If another site also has the same problem, perhaps the issue is related to your network or computer. Please check the network connection and check which version of OS and Browser version are you using? Then, try to Restart your browser, Restart your router, Restart your computer or Update your browser to the latest version.
Make sure you use propper audio device.

Chrome Autoplay Policy - Chrome 76

I'm building a kiosk media which runs on Chrome that plays video with audio. I know that chrome by default only allows autoplay for videos with muted props.
And i know that i WAS able to override this by enabling a flag in chrome via chrome://flags/#autoplay-policy
I have just updated to Chrome 76 and this flag seems to be gone and the autoplaying of video doesn't seem to work anymore!
Any idea how do i overcome this?
[Chrome 76.0.3809.100 (Official Build) (64-bit)] Mac OS Mojave
I just spoke to some developers from Google about this issue recently. I submitted a bug. They have been very helpful.
Even though autoplay policy chrome flag was removed in https://chromium-review.googlesource.com/c/chromium/src/+/1593800, you can still run Chrome with a specific autoplay policy from the command line.
Autoplay policy that does not require any user gesture.
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
--autoplay-policy=no-user-gesture-required
They say this command will stay, so that's good but even better Chrome allows you to always enable autoplay by explicitly allowing a website to make sound "Site Settings > Sound"
Good luck.
You can use command line code to execute chrome in kiosk mode with no-user-gesture-required:
google-chrome-stable --kiosk http://google.com/ --new-window --start-maximized --incognito --autoplay-policy=no-user-gesture-required --disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies &
According to the new policy of Chrome:
Chrome has prevented any sound, I also met this problem.
I just add this trigger click to my script page and it's really working correctly:
$('body).trigger('click');
I just add a div in my page and call click trigger on load page!
it works correctly!
<div id="test"></div>
<script>
$(function(){
$("#test").trigger("click");
})
</script>

Chrome: How to simulate new AutoPlay policy

In Google Chrome 66, autoplay policy changed.
You can read about it here:
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
As a developer, I need to develop workarounds.
Of course, the first step to developing for this scenario is being able to reliably reproduce the scenario where:
A user visits a site that does not have a significant enough MEI index.
Autoplay is disabled unless the video is muted.
Here's my issue.
Os X, Chrome 67.0.3396.99
Steps to Reproduce:
Disable MEI detection and autoplay using ALL of the Developer Switches
This means:
a) Visit chrome://flags/#autoplay-policy and change the behavior to Document user activation is required and restart Chrome.
b) Run Chrome using: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies
Visit a site that should allow autoplay, i.e YouTube.com
Expected Result:
Autoplay doesn't engage.
Actual Result:
It does.
Thanks in advance.
It turns out that
Step (a) appears to be unnecessary.
When running step (b) make sure that you close Chrome entirely first. If you get the message "Created new window in existing browser session", you are in trouble.
To reiterate:
Steps To Reproduce:
1) Quit Chrome entirely.
2) Run Chrome using: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies
3) Visit YouTube.com
Result:
Video starts paused.
I've found, additionally, that my videos will still autoplay unless I click the address bar and click "enter", rather than refreshing the page.

Flash object is not working after update of google chrome

Today google chrome updated to last version, before that update the website was working without any problem. It's working on firefox and internet explorer without any problem though.
What's wrong with google chrome ?
http://www.mersin-mezitli-satilik-daire.com/3-boyutlu-sanal-tur-mersin-mezitli-satilik-daire.php?iframe=3&anasayfa=1
This issue may be caused by the dreaded 'Pepper' Flash Player, which has also been breaking Flash content for me in Chrome.
I don't know what the solution is for your broader audience of Chrome visitors, but to fix the problem locally:
In a new tab, go to the URL: chrome://plugins/
Find the entry for 'Flash' and expand [+] Details if not already expanded
Look for the entry where the location of the plugin ends: ...PepperFlash\pepflashplayer.dll and click 'Disable'
You will hopefully have at least one other instance of Flash Player installed (if not, try installing a debug player from Adobe's website), and enable one of these.
I should mention, the Pepper Flash Player seems to regularly re-enable itself, possibly whenever Chome auto-updates itself, and I find myself having to repeat this process every couple of days.