Simple text link to open YouTube video in Colorbox

Created on 29 November 2022, over 2 years ago
Updated 30 June 2023, almost 2 years ago

Thank you for your wonderful module.

Problem/Motivation

The issue is pulling in the video thumbnail to open in modal causes pagespeed issues, so just want to have a text link to open modal.

Steps to reproduce

<p><a class="colorbox-load" href="https://youtu.be/aXAQJkCa7Yk?fs=1&amp;width=640&amp;height=480&amp;hl=en_US1&amp;iframe=true&amp;rel=0">Watch Video</a></p>

But the text link opens the video directly in YouTube and not Colorbox.

Most appreciate any suggestions on just to use a text link to open the video in Colorbox.

💬 Support request
Status

Active

Version

2.0

Component

Documentation

Created by

🇫🇷France liliplanet Cannes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India vaibhav_arora

    Hi, I have attached a proposed solution below which works at my end.
    Steps to follow :
    1.Install and enable colorbox and colorbox inline module .
    2. Use the below code to use for the integration of youtube videos in the source .

    <p>
        <a data-colorbox-inline="#youtube-video">YT video</a> <iframe style="display:none;" id="youtube-video" width="560" height="315" src="https://www.youtube.com/embed/aXAQJkCa7Yk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen=""></iframe>
    </p>
Production build 0.71.5 2024