Wp-calypso: Reader: VideoPress video not displaying when post created from Gutenberg

Created on 23 Nov 2018  路  5Comments  路  Source: Automattic/wp-calypso

A recent blog post I made doesn't seem to display any of the videos I added correctly.

Here's the post: https://wordpress.com/read/feeds/58287751/posts/2075961330

Steps to reproduce

  1. Create a new post using Gutenberg.
  2. Add some VideoPress blocks.
  3. Publish the post, and view it in the Calypso reader.
  4. The videos will all be black squares:

screen shot 2018-11-23 at 8 59 25 am

Same behavior in Chrome and Safari.

Reader [Type] Bug

Most helpful comment

You get points for trying to use all of our products at once!

All 5 comments

You get points for trying to use all of our products at once!

I took a quick look here and I can't reproduce in development on master, looking at the console in production it seems to be a bundle loading issue breaking the js:

Unhandled promise rejection Error: "Loading chunk 57 failed. (error: https://wordpress.com/calypso/activity~stats.1a45edb44ae199429227.min.js)"

@blowery could you take a look?

@westi I think the bundle loading might be a red herring. Looks like this is the culprit:

screen shot 2018-11-26 at 17 53 17

Seems that the Videopress iframes in this post might be failing our iframeIsWhitelisted check, so we don't add the correct sandbox attribute:

https://github.com/Automattic/wp-calypso/blob/5f15f3365213253724ca0d8798c6cb8160f00bc9/client/lib/post-normalizer/rule-content-make-embeds-safe.js#L51-L52

I'll see if I can find out why.

@westi I think the bundle loading might be a red herring. Looks like this is the culprit:

screen shot 2018-11-26 at 17 53 17

Seems that the Videopress iframes in this post might be failing our iframeIsWhitelisted check, so we don't add the correct sandbox attribute:

wp-calypso/client/lib/post-normalizer/rule-content-make-embeds-safe.js

Lines 51 to 52 in 5f15f33
} else if ( iframeIsWhitelisted( iframe ) ) {
iframe.setAttribute( 'sandbox', 'allow-same-origin allow-scripts allow-popups' );

I'll see if I can find out why.

Thanks, interestingly it worked fine for me in local dev...

Ah! There seems to have been a change of hostname for the iframe src (video.wordpress.com rather than videopress.com). https://github.com/Automattic/wp-calypso/pull/28868 fixes it.

Was this page helpful?
0 / 5 - 0 ratings