# Video link in the comments to display as embed video when published

**URL:** <https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862>\
**Category:** Ask for Help\
**Created:** [April 25, 2024, 6:06pm UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862 "2024-04-25T18:06:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/giovanni/32/74085_2.png) [@Giovanni](https://community.glideapps.com/u/Giovanni)\
**Post date:** [April 25, 2024, 6:06pm UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862/1 "2024-04-25T18:06:43Z")

</div>

Hello Gliders,

is there a way to let the users past a video link in the comment and display it as an embed video after it’s published?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/0/d09f9ef6715d712cb5d8a0aaa5b5c1b6d0473616.jpeg)

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [April 25, 2024, 9:07pm UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862/2 "2024-04-25T21:07:05Z")

</div>

### Edit:

No, it’s not possible because you can’t include `<iframe>` html in a chat message. 😞

### Original response

It’s not perfect, and might cause more issues than it’s worth, but if just youtube, possibly. You’d need to account for whether it’s youtu.be/VIDEOID or [youtube.com/watch?v=VIDEOID](http://youtube.com/watch?v=VIDEOID), but as long as you can isolate the ID, then you can create youtube embed HTML using a template column.

> **This bit of javascript can pick out a YouTube id**
>
> ```auto
> function getYouTubeVideoID(url) {
> const regex = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\s*[^\/\n\s]+\/|(?:v|e(?:mbed)?)\/|\S+?[\?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/;
> 
> const match = url.match(regex);
> if (match) {
> return match[1];
> } else {
> return;
> }
> }
> 
> // Example usage:
> return getYouTubeVideoID(p1)
> 
> ```

In an ifThenElse column, you’ll want to check if the javascript above outputs a valid ID. If so, output the html, else output the message.

---

<div class="post-metadata">

**Author:** ![Giovanni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/giovanni/32/74085_2.png) [@Giovanni](https://community.glideapps.com/u/Giovanni)\
**Post date:** [April 26, 2024, 7:18am UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862/3 "2024-04-26T07:18:08Z")

</div>

Thank you for the reply Robert! I’m going to keep the links in the comments…

p.s. I’m loving your tutorials! I’ve been learned a lot from your expertise!

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [April 26, 2024, 12:04pm UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862/4 "2024-04-26T12:04:32Z")

</div>

Thanks for the kind words! Let me know if there’s a topic that needs further explaining!

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [April 26, 2024, 12:30pm UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862/5 "2024-04-26T12:30:41Z")

</div>

Are you interested in replacing the URL with a thumbnail from YouTube? By adding a YouTube Thumbnail column and a bit of HTML markup, you can create a play button that resembles a YouTube thumbnail. At least your users will get more information through the thumbnail.  
Of course, this will open a new window, just like clicking on the URL.

---

<div class="post-metadata">

**Author:** ![Giovanni](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/giovanni/32/74085_2.png) [@Giovanni](https://community.glideapps.com/u/Giovanni)\
**Post date:** [April 26, 2024, 4:21pm UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862/6 "2024-04-26T16:21:22Z")

</div>

Yes Himaladin! This could be a smart solution. But are you sure that the thumbnail will be displayed? The type of data displayed for the content is a “text” type. How do you suggest me to structure the new column for the Youtube Thumbnail to try if it works?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/8/c816fa35ea584ca4221fd459c0599c0f704df446.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 26, 2024, 4:27pm UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862/7 "2024-04-26T16:27:23Z")

</div>

If I recall correctly, you can inject html into the comments that are displayed, so it would be a matter structuring a template column that joins the comment with HTML that contains the image and link, and then display that template column in your comments. I believe the comments component will render HTML content.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [April 26, 2024, 4:27pm UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862/8 "2024-04-26T16:27:29Z")

</div>

Ah. That’s a smart solution and very doable with html.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [April 26, 2024, 4:40pm UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862/9 "2024-04-26T16:40:11Z")

</div>

Here’s how!

 ![CleanShot 2024-04-26 at 12.39.27](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/b/3b83cf6d8e76ea063d80b306655fdc4e394b43f3.jpeg)

https://www.loom.com/embed/b8442a5f43b24e2eaa009635b7d1c88a

The javascript column is listed above ☝

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [May 3, 2024, 5:34pm UTC](https://community.glideapps.com/t/video-link-in-the-comments-to-display-as-embed-video-when-published/72862/11 "2024-05-03T17:34:52Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
