Youtube Links in Alloy

Hello,
Sorry if this topic has been discussed previously but I couldn’t find any posts on it here.

Just made a news section for a client and noticed the youtube embeds for Alloy posts are not showing any more. A quick glance at my own websites old blog posts show youtube appear to have changed their embed code. Wondering if this might be causing the issue?

(Sorry, didn’t know how to write code and have it show so took a screenshot!).

I tried just using the old embed code instead but it caused Alloy to do funk stuff like hide my side column of Categories etc as well as erase the read more and tabs at the bottom! Seems the page just gets to the youtube embed code, sees the video and stops reading anything else (the videos aren’t that good I sure you).

Hi there @britpkb

I published a test using a standard YouTube embed that is supplied when sharing a video from YouTube’s site in a post and it seems to be working fine here. You can see it on this test blog post:

I used the following embed tag supplied by YouTube:

<iframe width="560" height="315" src="https://www.youtube.com/embed/oa_mtakPlfw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

I also used your “old” embed code and it did indeed fail because of cross origin problems. That said, it you use the URL provided from the SHARE dialog on the YouTube site, the one that includes an embed path in the URL, but use your “old” code, it too works. Like so:

<iframe width="300" height="169" src="https://www.youtube.com/embed/oa_mtakPlfw" frameborder="0" allowfullscreen></iframe>

That said – Both methods work here for me so far in testing, but I would only use the new embed that YouTube is providing to you. They’re providing you that embed code for a reason, and that reason is that is how they want it to work.

1 Like

Hello Adam!
Many thanks for the speedy reply :slight_smile:
You’re right! It worked like a charm when I just tried it in their editor.

Just tried to recreate the problem my end. I think what happened was they were trying to embed the youtube videos to the top of the blog post which was causing the summary to not read the entire code. I’ll let them know they need to embed any videos they want to the end of future posts.

Many thanks again. Have a lovely weekend :wave:t2:

1 Like

Yeah, embeds won’t show correctly if they’re within that summary area. You can place them in the post itself further down, just make sure they’re past the character count for the summary. :+1:

Glad you got it all sorted out though.

1 Like