I’m trying to embed a YouTube video in my product page. At the end of the video it shows related video, I want those video to be only from the same channel. In that case I need to wrap the video link with a
Topic summary
A user wants to embed a YouTube video on their product page while ensuring that only videos from the same channel appear in the related videos section at the end. This requires using an <iframe> tag with the ?rel=0 parameter appended to the video URL.
Solution provided:
- Use an
<iframe>embed code with the video URL in the format:https://www.youtube.com/embed/VIDEO_ID?rel=0 - Include standard iframe attributes like width, height, and allowfullscreen
Status: Resolved. The user confirmed the solution worked for their needs.
use this code
<iframe width="560" height="315" src="https://www.youtube.com/embed/JO2WKFeJuZY?rel=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="">
</iframe>
Thank you so much.
1 Like