• Resolved thedrumdoctor

    (@thedrumdoctor)


    I normally embed YouTube clips without any problems into Woocommerce product descriptions using the ‘Add Media’ > ‘Insert from URL’ route. I always use the shared link given to me directly from YouTube.

    However, I recently made a ‘clip’ and it won’t embed using the same method. YouTube clips are hosted from a YouTube user’s channel and are set to public. The clip I made I tested in a private browser so it is publicly accessible.

    The format of the normal YouTube embed for the video is as follows:

    https://youtu.be/vCEJJQwupwE?si=jd-zEvefH5_-qQRS

    This embeds and displays using the ‘Add Media’ method which ends up as, [embed]https://youtu.be/vCEJJQwupwE?si=jd-zEvefH5_-qQRS[/embed] once it’s in the product listing.

    The format of the ‘clip’ version is as follows:

    https://www.youtube.com/clip/Ugkxz-FmjFrTtCNvKx-8wGJnfWksbuSVFgO6

    The ‘clip’ version will not insert using the ‘Add Media’ method and will not show a preview.

    However, if I choose to share the clip via the YouTube generated <iframe></iframe> tags, the clip will render in the editor on the product description page! (However, it won’t save as iframes seem to be a security risk.)

    I suspect the native ‘Add Media’ method cannot parse the URL. I note the ‘clip’ URL has a subdirectory included but this shouldn’t be a problem as YouTube is on the list of WordPress oEmbed providers.

    I do use Breeze for caching, but YouTube works fine as an embed.

    It’s not the end of the world, but it would be nice to know why the ‘clip’ URL won’t embed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @thedrumdoctor

    The URL for a standard YouTube video is much simpler than the one for a clip. The standard YouTube video URL is parsed by WordPress’s oEmbed feature, which allows it to be embedded directly into a post using the ‘Add Media’ function. However, the URL for a YouTube clip is more complex and may not be recognized by the oEmbed feature, resulting in the issue you’re experiencing.

    While YouTube is indeed on the list of WordPress oEmbed providers, it’s possible that the oEmbed feature doesn’t support the specific URL structure of YouTube clips. This could be why the clip URL isn’t being parsed correctly and why it isn’t working with the “Add Media” function.

    As a workaround, you could embed the video into your product description using the standard YouTube video URL instead of the clip URL. Alternatively, you could use a different method, such as a plugin like StreamWeasels YouTube Integration that supports the YouTube clip URL structure.

    Please note that while iframes can be used to embed videos, they are generally not recommended due to potential security risks.

    I hope this provides some clarity. Please let us know if you have any other questions!

    Thread Starter thedrumdoctor

    (@thedrumdoctor)

    Thank you very much for your reply. This has confirmed what I was thinking.

    I will not be using iframes either!

    Many thanks.??

    Plugin Support Beauty of Code (woo-hc)

    (@beautyofcode)

    Hey @thedrumdoctor ,

    Glad to hear that @shameemreza was able to help point you in the right direction here!

    Since this has been resolved, feel free to create a new topic if you need any further help. ??

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.