Embedding YouTube links

I was hoping I’d see another post on this, but previously it was easy to embed YouTube vids right into the text box and now they are showing up as hyperlinks.

Is there a fix?

3 Likes

This should still be working. Do make sure you have the link on it’s own line, as that’s a requirement for our onebox to function.

If you can share any examples of where this isn’t working, this might be able to help us track down further issues though!

4 Likes

Yes, I know about having the link on its own line. All the links I have are unlisted and they are out client’s so I feel weird using them… but it’s happening on everyone’s posts…

1 Like

Here’s what I’m seeing

1 Like

Does it work if you use a listed video? It’s possible something is broken with unlisted links. Google may have made a change blocking onebox from rendering those videos.

2 Likes

It doesn’t seem to be working on our site with either listed or unlisted. It IS working here if I post an unlisted video.

1 Like

Here’s an unlisted video for comparison:

It’s possible that YouTube may be blocking requests from the IP of your server?

If you run, for example:

puts Onebox.preview('https://youtu.be/E5oGcdqz5xk')

in your server’s rails console, do you get something like:

<div class="onebox lazyYT lazyYT-container" data-youtube-id="E5oGcdqz5xk" data-youtube-title="demo unlisted link" data-parameters="feature=oembed&amp;wmode=opaque">
  <a href="https://www.youtube.com/watch?v=E5oGcdqz5xk" target="_blank" rel="nofollow ugc noopener">
    ![](upload://hp5dMCYhQ42qK2Oru9gQ6Q9R0nY.jpeg "demo unlisted link")
  </a>
</div>
8 Likes

Yes, your server ip is blocked by YouTube. This has come up a number of times recently.

2 Likes