amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Viewers should allow 'encrypted-media' in Feature Policy

Open nightpool opened this issue 8 years ago • 4 comments

What's the issue?

When using an iframe or amp embed that makes use of Encrypted Media Extension APIs, things will work fine locally but fail in the players. This is because player iframes have to explicitly whitelist Feature Policy features that are allowed to child iframes. When the allow attribute was added to amp-iframe, it was suggested that players allow payment, geolocation, microphone and vr. I believe encrypted-media should be added to this list, because most iframes are some sort of media embed and as EME is gaining adoption, many sites are using it for long-form or heavily encumbered media, such as streaming services. Embedding EME-protected media is a use case that amp should support.

How do we reproduce the issue?

this is a pretty simple issue to observe visually by inspecting the viewers, but I could throw together a test document if it would be useful.

What browsers are affected?

All browsers that require Feature Policy for EME by default. I don't know how big this is, but it at least affects Chrome versions since 64 (January 2018) and maybe some Safari versions (unconfirmed)

Which players are affected?

I would expect most players are affected, but haven't confirmed beyond the google amp cache and cloudflare players.

nightpool avatar Sep 28 '18 01:09 nightpool

@ericfs Could you take this on for the Google viewer? @ssantosms for Bing.

cramforce avatar Sep 28 '18 02:09 cramforce

@nightpool if you can provide a test document, it would be helpful for us

sveronesi avatar Sep 28 '18 17:09 sveronesi

Had some time to get to the test document today. Here you go: https://nightpool.github.io/amp-eme/

works standalone: image

fails in players: https://search.google.com/test/amp?view=search-preview&id=2BZpGcopYn2fIAeWoW2PDA image

all the needs to be done, as i understand it, is adding allow="encrypted-media" to the iframe, or appending it to the current allow list (on google, allow="geolocation; encrypted-media")

nightpool avatar Oct 02 '18 18:10 nightpool

Filed b/117329765 internally

ericfs avatar Oct 05 '18 18:10 ericfs