YouTube and Vimeo Embeds not Showing

Ryan Chin
For some reason when I try to display a Youtube or Vimeo video it's not working.  I can see the thumbnail of the video if I return to edit the Post that the field is in.

However, it doesn't display on my show view.  Embed works for tweets for me (although no images show), and rich text is displaying when I use the formatting tools of Trix on text.

I think that it's because the embed node is coming across as null for the videos.

When I view the HTML for the tweet, it looks like this:
<div class="trix-content">
  <div><span><action-text-attachment sgid="BAh7CEkiCGdpZAY6BkVUSSI3Z2lkOi8vanVtcHN0YXJ0LWFwcC9BY3Rpb25UZXh0OjpFbWJlZC81P2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg9hdHRhY2hhYmxlBjsAVEkiD2V4cGlyZXNfYXQGOwBUMA==--99ce3161ce8597335fe771f9788ae67b78045f6e" content-type="application/octet-stream">  
<div class="embed">
    <blockquote class="twitter-tweet">
<p>Make instant slushies with this supercool science trick <a href=""></a> <a href=""></a></p>— Popular Science (@PopSci) <a href="">April 18, 2020</a>

However, the HTML for the video renders like this:
<div class="trix-content">
  <div><action-text-attachment sgid="BAh7CEkiCGdpZAY6BkVUSSI3Z2lkOi8vanVtcHN0YXJ0LWFwcC9BY3Rpb25UZXh0OjpFbWJlZC8xP2V4cGlyZXNfaW4GOwBUSSIMcHVycG9zZQY7AFRJIg9hdHRhY2hhYmxlBjsAVEkiD2V4cGlyZXNfYXQGOwBUMA==--7dd0e6ebe60c2063b221ddf286adc9378a6092b1" content-type="application/octet-stream">  
<div class="embed">

In the action_text_embeds table, the record looks like this:
url =

fields= {
    "provider_url": "",
    "version": "1.0",
    "title": "The Sensitive Drill Sergeant - SNL",
    "author_name": "Saturday Night Live",
    "height": 270,
    "thumbnail_width": 480,
    "width": 480,
    "html": "<iframe width=\"480\" height=\"270\" src=\"\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>",
    "author_url": "",
    "provider_name": "YouTube",
    "thumbnail_url": "",
    "type": "video",
    "thumbnail_height": 360

I don't understand why <div class="embed"> has nothing in it for my video embeds.
Chris Oliver
Make sure you're allowing the iframe tag, etc through the sanitizer:
Ryan Chin
Thanks  !
Ryan Chin
Hi Chris.  If I wanted to add a wrapper or CSS to the video embeds to make them responsive, something like this.  How would you recommend doing that?
Ryan Chin
Thanks Chris!
You’re not receiving notifications from this thread.
© 2022 Jumpstart Pro by GoRails, LLC