Chrome: How to simulate new AutoPlay policy - google-chrome

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.

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/).

How can I enable autoplay in 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.

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>

html video tag fullscreen control does not work properly with Chrome

I do not speak English well..
jsp sources :
<video controls controlsList="nodownload" name="media" width="100%" id="vodArea">
<source src="~~~" type="video/mp4" id="vodAreaSrc">
</video>
There is no problem here.
When the full screen button in a video is clicked, Full screen is not maintained in chrome. (Firefox is no problem)
It returns to the original screen after it becomes full screen.
example url
https://www.w3schools.com/html/html5_video.asp
chrome version : 73.0.3683.75 (64bit)
os : window10 64bit
Why is there a problem with my Chrome?
Instructions here are for youtube but these may still apply.
uninstall themes
disable extensions
launch chrome with switches: "chrome.exe --disable-extensions"
turn off hardware acceleration
Reset Chrome to default settings. Removing default settings may fix the full-screen problem, though keep in mind it will also remove your current settings:
Click ⋮ in the top-right corner.
Click Settings.
Scroll down and click Advanced.
Scroll down and click Restore settings to their original defaults.
Click Reset settings when prompted.
reinstall chrome
I'd try 1-3 first, then 4, then if all else fails, 5.

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.