[Support request] YouTube Embed works fine in admin panel, shows only URL on live site

Home Forums Support [Support request] YouTube Embed works fine in admin panel, shows only URL on live site

Home Forums Support YouTube Embed works fine in admin panel, shows only URL on live site

Viewing 15 posts - 16 through 30 (of 34 total)
  • Author
    Posts
  • #2053251
    Ying
    Staff
    Customer Support

    Hi Zoltan,

    Can you go to this website, paste the video URL there, copy the generated Embed code?
    https://embedresponsively.com/

    Then paste the embed code to a HTML block in the block element.

    Let me know if that works

    #2053491
    Zoltan

    Hi Ying,

    Yes, it works. Thank you for your workaround solution, however I wonder what is the reason for the Youtube Block failure (missing iframe code) when using together with GP Elements-Block. Who should be responsible to solve it, WP or GP?

    KR, Zoltán

    #2055077
    Ying
    Staff
    Customer Support

    Glad it works.

    I haven’t had time to dig deeper on this, not sure what exact the cause is.

    #2057204
    Maik

    I have the exact same problem with not working youtube-blocks.
    1. As long as I use the youtube-block in normal pages, it works fine for me in backend and also frontend. The video is displayed and everything is fine.
    2. If I switch to gp-elements to build some global content, it breaks the function of the youtube-block in frontend and no video is displayed. It´s confusing, because the backend of the gp-element seems to be ok and the video is displayed.

    So I also would say, there´s “something” in the way how gp-elements are working and it could be a GP problem, if normal sites are working fine, right? I hope this helps to figure out where the problem is.

    And it works well, if I just use a html-block and some embedding code from https://embedresponsively.com/ like David also mentioned here.

    #2057210
    Elvin
    Staff
    Customer Support

    Hi @Maik,

    This issue is most likely site-specific as it doesn’t occur on all user’s sites. A plugin or PHP snippet is likely messing up w/ the script WordPress uses.

    On a fresh site w/ minimal plugins installed (GP Premium + GenerateBlocks), the embed blocks work perfectly.

    #2057212
    Maik

    Hi Elvin.
    Good to know, I’ll dig deeper here too, thanks for the hint with the fresh setup, I´ll test this. (I´ve never used yt-blocks like this in a fresh setup.)

    PS: My post was just another source of how it works for me and how I´ve “fixed” it for now. I just love this forum as a great source of information about every problem or question around using GP. Thanks guys, for this great work!

    #2057221
    Elvin
    Staff
    Customer Support

    Yes, having a fresh install or at least having all plugins disabled gives you a baseline if the issue is a bug on WordPress core block itself or if a plugin is causing it.

    No problem. Glad to be of any help.:D

    #2204420
    Steve

    Also running into this issue in the following context:

    Add New Element -> Block -> Block Type = Hook (before_footer)

    It seems that auto oembed is not run on this Element as it’s outside of a post or page content area. Looks fine in the Element editor but on the frontend you get only a youtube URL in text format.

    #2204505
    Ying
    Staff
    Customer Support
    #2206858
    Steve

    Hi Ying, thank you for the reply.

    Yes that embed code works fine. However it’s important the general Youtube/Video core block works for content editors so I’d love to sort out a longer term solution. I believe this issue may be related.

    #2207121
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Can you see if adding this snippet makes a difference?:

    add_filter( 'generate_do_block_element_content', function( $content ) {
        global $wp_embed;
        $content = $wp_embed->autoembed( $content );
    	
        return $content;
    } );

    Let me know 🙂

    #2208308
    Steve

    That totally worked! Thanks Tom and Ying!

    #2208435
    Tom
    Lead Developer
    Lead Developer

    Glad we could help! We’ll get this fixed in GPP.

    #2223188
    Jay

    This worked for me as well. Youtube embed block being used in elements as a hook was not showing the video and this fixed it. Thank you for providing the solution.

    #2241566
    Bob

    Hi I’m having the same problem — for both YouTube videos and play lists – they will not show up in elements. My question: Where do I add the code that Tom posted?

Viewing 15 posts - 16 through 30 (of 34 total)
  • You must be logged in to reply to this topic.