• Resolved Nathan Hawkes

    (@natehawkes)


    I seem to be having an issue with embedding YouTube videos with the embed block. The issue is almost identical to the one listed here: https://github.com/WordPress/gutenberg/issues/1314

    1) I open my post that I want to edit.
    2) I insert a YouTube Embed block.
    3) I paste in my YouTube video URL and click Embed.
    4) The embed block tells me Sorry, we could not embed that content.
    5) When I preview the post, the video appears, embedded into the page as expected.

    This is only on video blocks. If I create a Classic block, it will embed the preview as expected. It is only on video blocks.

    I’ve followed the steps listed in the issue but I’m getting nowhere. The network tab shows me effectively the same code as the post linked above (albeit not in the same order):

    {
        "code": "rest_no_route",
        "message": "No route was found matching the URL and request method",
        "data": {
            "status": 404
        }
    }

    I’m using WordPress 4.9.4 and Gutenberg 2.3.0.

    Unlike the original post, however, my permalinks were never set to plain, but were already instead set to Month and Name. I have changed them to plain and then back to Month and Name, and that does nothing. Not only that, but the REST API seems to be responding normally (my site’s /wp-json/ URL seems to give me a whole list of endpoints) where the issue above didn’t seem to have that.

    In the GitHub issue above, they said that this was not a Gutenberg issue per se, but rather an issue with the web server. For that reason, I am posting it here instead of on GitHub. If it does look to be an issue with Gutenberg, I shall repost it there.

    Could someone please assist me and help me find out what on earth is wrong with it?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tammie Lister

    (@karmatosed)

    Thanks for reporting this, I must say having trouble recreating, so if it’s ok can we dig a little more into what maybe is going on? Is it all videos or a specific one? Is it any particular browser or all you are experiencing this on?

    Thread Starter Nathan Hawkes

    (@natehawkes)

    By the looks of things, I found the issue.

    When I first asked, I hadn’t checked for issues with themes, so I switched back to Twenty Seventeen and found that it worked. In my custom theme, I have a function that removes certain tags from the header, of which one that was recommended to include (I forget where from though) was rest_api_init. Whilst the wp-json file seems to be displayed, that remove_action hook seemed to be the issue and the REST API wasn’t doing its thing. Once I’ve commented that out, the embeds work fine.

    Thanks for looking though. Just have to go through my other themes and remove that hook now.

    I also have this problem. I can give you access to the site, because i am just build it. So is nothing important right now

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘YouTube videos not embedding’ is closed to new replies.