- This topic has 33 replies, 11 voices, and was last updated 1 year, 10 months ago by David.
-
AuthorPosts
-
December 18, 2021 at 1:43 pm #2053251YingStaffCustomer 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
December 19, 2021 at 3:19 am #2053491ZoltanHi 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
December 20, 2021 at 6:14 pm #2055077YingStaffCustomer SupportGlad it works.
I haven’t had time to dig deeper on this, not sure what exact the cause is.
December 22, 2021 at 5:31 pm #2057204MaikI 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.
December 22, 2021 at 5:38 pm #2057210ElvinStaffCustomer SupportHi @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.
December 22, 2021 at 5:42 pm #2057212MaikHi 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!
December 22, 2021 at 6:03 pm #2057221ElvinStaffCustomer SupportYes, 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
April 29, 2022 at 2:58 pm #2204420SteveAlso 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.
April 29, 2022 at 9:17 pm #2204505YingStaffCustomer SupportHi Steve,
Have you tried this solution?
https://generatepress.com/forums/topic/youtube-embed-works-fine-in-admin-panel-shows-only-url-on-live-site/page/2/#post-2053251May 2, 2022 at 11:24 am #2206858SteveHi 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.
May 2, 2022 at 7:29 pm #2207121TomLead DeveloperLead DeveloperHi 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 🙂
May 3, 2022 at 2:17 pm #2208308SteveThat totally worked! Thanks Tom and Ying!
May 3, 2022 at 7:13 pm #2208435TomLead DeveloperLead DeveloperGlad we could help! We’ll get this fixed in GPP.
May 17, 2022 at 9:12 pm #2223188JayThis 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.
June 2, 2022 at 7:58 am #2241566BobHi 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?
-
AuthorPosts
- You must be logged in to reply to this topic.