allow="autoplay" does not forward the message to the video inside an iframe

2,055 views
Skip to first unread message

j...@corp.webedia.fr

unread,
May 15, 2018, 1:40:15 PM5/15/18
to Chromium-dev
Hi,

I have a site where I have two videos that are played after a click on a button. The two videos are intended to play with autoplay and sound enabled. Obviously it's after a click so there's an interaction with the page.

The first video is on the main domain, and the second one is in an iframe. I know that the policy in Chrome > 66 disables it but I'm using the parameter allow="autoplay" on the iframe, and it does not seem to work correctly.

I'm refering to this doc:
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#iframe

Any idea ?

Ian Clelland

unread,
May 15, 2018, 2:22:08 PM5/15/18
to j...@corp.webedia.fr, chromium-dev
This should be working in Chrome 66; I just checked the code, and it is written like I would expect it to be, although I haven't tried a test page recently.

Is your main page also in an iframe? You need to use <iframe allow="autoplay"> in every iframe that crosses an origin boundary, up to the top-level document, in order for it to work. If you have that, then a user gesture in the frame or in any of its parents should be sufficient to allow the video to play.

Other, less likely reasons why it might not work are:
  - You have a syntax error in the allow attribute, like using allow="fullscreen autoplay" rather than allow="fullscreen; autoplay"
  - The autoplay policy flag is turned off in chrome (chrome://flags/#autoplay-policy)
  - You're sending a Feature-Policy HTTP header with the document that disables autoplay

Other than that, it *should* work. Do you have a demo page where it isn't working that you can share? If you want to file a bug at https://crbug.com/ with a test case, that would be a useful place to track the issue.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/c165fa76-26ed-476f-881d-0601968df687%40chromium.org.

Julien Ricard

unread,
May 16, 2018, 9:25:00 AM5/16/18
to Ian Clelland, chromium-dev
Hi,

There's no header, the policy flag is set on "default", there's no syntax error. The second video is on another domain, and the "video" html is written in javascript through jwplayer.

The scenario is that there is a click that triggers a first video (with sound, and autoplay, that plays correctly with the sound), and then opens an iframe with allow=autoplay but the video does not play when I host the javascript that does all of that on another domain, on the same domain everything is fine, on different domains on my local computer it's working fine, it's not working on production (as always :-) ?). 

My tests are inconsistent (it's working fine in dev but not in production) but there may be something in the doc that I may not read properly. I'm trying to understand the differences that explain this behaviour.

I'm going to make a test page or will update.

Thank you :)
Julien
Reply all
Reply to author
Forward
0 new messages