Forum Discussion
Issues with Embedded YouTube Video
Not sure this is the right thread, but is there a way to edit the embed code of a YouTube video to only play a segment? I see when I copy the embed code, I can designate a start time, but can I add "code" to where I want it to stop?
Hello ElyseSmith-0e4a,
Thanks for reaching out!
You can specify the start and end time of an embedded YouTube video by adding this parameter to your embed code:
start=60&end=70;
The number represents the duration in seconds. Here's an example with the correction application of the modifiers:
<iframe width="560" height="315" src="https://www.youtube.com/embed/nn3lwlo6bAE?si=420t6CD4vbxMHQfq&start=60&end=70;" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
Hope this helps!
- ElyseSmith-0e4a7 months agoCommunity Member
Hi Jose! Thanks for the reply. I tried your suggestion and it gave me an error message when I published stating video couldn't be played. Here's what I added to the embed code as I wanted the video to start at 8 seconds and end at 244 seconds. Any suggestions?
<iframe width="560" height="315" src="https://www.youtube.com/embed/saxfavo1oqo?si=iwyztfibwghvynew&start=08&end244;" title="youtube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" width="560" height="315"- JoseTansengco7 months agoStaff
Hello ElyseSmith-0e4a,
It looks like your embed code has two links to a video, so you may have pasted some of the elements twice. Please try removing the duplicate lines to see if this fixes the problem.
<iframe width="560" height="315" src="https://www.youtube.com/embed/saxfavo1oqo?si=iwyztfibwghvynew&start=08&end244;" title="youtube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
- ElyseSmith-0e4a7 months agoCommunity Member
Thanks Jose. I corrected the duplication which fixed the playback error, but adding the "start" and "end" time doesn't impact it. It still plays the entire 11-minute video and doesn't stop where I want it to.
Related Content
- 11 months ago
- 14 days ago
- 14 days ago