Autoplay media in headless / devtools protocol

890 views
Skip to first unread message

cha...@tokbox.com

unread,
Jan 29, 2018, 3:32:48 PM1/29/18
to headless-dev
Hi all-
I noticed that video playback has stopped functioning in some recent update (currently running M64 in my testing). I assume this is related: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
Unfortunately, this doesn't work well for we few headless users, and I am not seeing any easy workarounds. Most of my testing relies on playing back some dynamic content and recording the results to video. Without predictable playback behavior, the videos are not particularly useful.

So far, I've tried:

* Using --ignore-autoplay-restrictions
* Using --no-user-gesture-required
* Using both of the above simultaneously
* Adding &autoplay=1 to youtube URLs

Additionally, I observe a large number of "400 Service Worker Fallback Required" messages on the network domain for GET requests to the googlevideo.com/videoplayback API -- I have no idea if this is related or not. I'm not seeing anything in Console API that hints at what could be broken, or how I can work around it. Has anyone else run into this or can suggest what I might try to get a more desirable result?

Kind thanks,
Charley

Charley Robinson

unread,
Jan 30, 2018, 4:26:46 PM1/30/18
to headless-dev
Hi all-
The answer to the previous question is to use the no-user-gesture-required flag not as a flag, but as an autoplay policy:

'--autoplay-policy=no-user-gesture-required'

This should fix your autoplay issues on headless. I don't really know what --ignore-autoplay-restrictions should be doing, but the result is almost certainly not to ignore the autoplay restriction policy. If this seems like a bug to anyone, please let me know and I'll be happy to file it.

Best,
Charley

Sami Kyostila

unread,
Feb 5, 2018, 10:50:38 AM2/5/18
to Charley Robinson, headless-dev
Hi Charley,

Thanks for reporting the solution to this. I just wanted to mention that the --ignore-autoplay-restrictions switch was removed in December which explains why it's not working.

- Sami

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/1674a714-3bf5-4d7b-b8ca-3a7d3f277e22%40chromium.org.

Charley Robinson

unread,
Feb 5, 2018, 12:21:32 PM2/5/18
to Sami Kyostila, headless-dev
Thanks Sami- 
That makes a lot of sense!
If anyone knows or is in touch with peter@chromium, it might be useful to add a more forceful note to his handy list of switches about that flag.
Best wishes,

Charley Robinson
Staff Engineer - Research & Development | TokBox, Inc.
UTC -0700 MST

To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev+unsubscribe@chromium.org.
Reply all
Reply to author
Forward
0 new messages