Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stine 3 posts 73 karma points
    Feb 08, 2024 @ 09:58
    Stine
    0

    Embedded video not showing (v. 7.5.8)

    I have a problem with embedded videos on our website.

    There is no problem attaching the YouTube video and it's also showing in preview, but when I've saved and published, and I'm accessing our website the video doesn't show.

    I have temporarily added a link to video that works fine, so this makes no sense to me.

    I have no idea how to fix it, hope u can help :)

  • Owain Jones 60 posts 410 karma points MVP 4x c-trib
    Feb 08, 2024 @ 11:44
    Owain Jones
    0

    Hi Stine, the YouTube embed appears to be working for me when I visit the page and allow cookies.

    enter image description here

  • Stine 3 posts 73 karma points
    Feb 14, 2024 @ 12:01
    Stine
    1

    Thank you!!!

    It's the cookies. When accepting only the necessary cookies you can't see the videos, however when you accept all you can see it :)

  • Owain Jones 60 posts 410 karma points MVP 4x c-trib
    Feb 14, 2024 @ 12:56
    Owain Jones
    0

    You're welcome :)

    Also, a method I usually use, to help inform users, is to show a placeholder instead of the embed when a user hasn't accepted cookies.

    For example, the YouTube and Twitch embeds on the bottom of this page: https://www.ynchwarae.cymru/ A screenshot of the ynchwarae.cymru homepage, showing the placeholders for the Twitch and YouTube embeds

    The way I did this was, in my HTML, I have a placeholder element with custom attributes that hold information on the embed:

    <div class="iframe-placeholder"
                        data-type="@Model.Type"
                        data-src="@Model.Url"
                        data-height="@Model.Height"
                        data-width="@Model.Width">
         // ...
         <span class="iframe-placeholder__text">@Model.Type.ToString() Embed Disabled - Please accept cookies to enable @Model.Type.ToString() embeds</span>
         // ...
    </div>
    

    And I have some JavaScript that will check the cookie consent, and replace the placeholder with the actual embed if the user has accepted the necessary cookies.

Please Sign in or register to post replies

Write your reply to:

Draft