How to loop multiple parts of a YouTube video in a row
Updated
YouTube cannot do this on its own. Its loop option repeats the whole video, and an embed link takes a single start and end point. To play, say, 1:20–1:43, then 2:02–2:10, then 2:30–2:49 and start over, you need either a few lines of JavaScript using YouTube’s IFrame Player API or a looper that chains sections for you. In ClipBack you mark the first part, click + Add section for each further part, and save them as one loop with one link.
Key facts
- YouTube’s own loop repeats the whole video or playlist. It has no start or end point.
- Embed links take one
startand oneend, so they cover a single stretch and play it once. - Chaining sections needs code (the IFrame Player API) or a looper such as ClipBack.
- Order is up to you: the sections do not have to follow the order they come in the video.
- ClipBack: as many sections per loop as you like, of any length, free.
When one loop is not enough
A single loop repeats one stretch of video. Plenty of practice material is not one stretch:
- A song’s hard parts: the verse riff and the chorus, without the solo in between that you already know.
- Choreography: the counts you are learning and the transition into them, when the tutorial explains something else in the middle.
- Language practice: several phrases scattered through one scene or interview, heard back to back.
- Skipping filler: the parts of a long video you want to hear again, without the intro and the talking in between.
Making one loop per part works, but then you switch between them by hand. Chaining the parts into one loop plays them in sequence and repeats the whole sequence.
Chain sections in ClipBack
- Load the video. Paste the link into ClipBack and click
Load Video, or change
youtube.comtoclipback.tvin the address bar. - Mark the first part. Drag the two handles, or type the times into Start and End. Turn on Snapback to hear each handle as you move it.
- Click + Add section. A new section appears after the current one, and the handles now move that one. The other sections stay faintly marked on the track.
- Repeat for each part. The list under the track shows every section with its times. Click a section to edit it again, use the arrows to change the order and ✕ to remove one.
- Click Play all to hear the whole sequence, including the jumps between sections. Touching a handle goes back to looping just the section you are editing.
- Name it and click Create Clip. The loop gets its own link and plays the sections in order, then starts over.
On the loop’s page the progress bar covers the whole sequence, with a small mark where one section hands over to the next. A loop with several sections works like any other: you can slow it down, add it to a playlist, where it moves on only after its last section, or embed it on a website.
Signed in, you can add, remove or reorder sections later with Edit Clip.
With code: the IFrame Player API
On your own website you can chain sections with YouTube’s IFrame Player API. Each section is loaded with a start and end point, and when it ends the next one is loaded. Change the video ID and the list of sections, which are in seconds from the start of the video:
<div id="player"></div>
<script>
var VIDEO_ID = 'dQw4w9WgXcQ';
var SECTIONS = [[80, 103], [122, 130], [150, 169]]; // [start, end] in seconds
var current = 0, player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
videoId: VIDEO_ID,
playerVars: { start: SECTIONS[0][0], end: SECTIONS[0][1], playsinline: 1 },
events: {
onStateChange: function (event) {
if (event.data === YT.PlayerState.ENDED) {
current = (current + 1) % SECTIONS.length;
player.loadVideoById({ videoId: VIDEO_ID,
startSeconds: SECTIONS[current][0],
endSeconds: SECTIONS[current][1] });
}
}
}
});
}
</script>
<script src="https://www.youtube.com/iframe_api"></script>
loadVideoById, notseekTo. YouTube’s reference says aseekTo()call cancelsendSeconds, so a sequence built on seeking plays straight past each end point.- Use whole seconds for the first section. The
startandendplayer parameters take whole numbers. - Expect a short pause at every jump while the player reloads the next section. Avoiding it means polling the current time and seeking yourself, which is more code to write and maintain.
Which to use
| YouTube loop | Embed link | IFrame Player API | ClipBack | |
|---|---|---|---|---|
| Parts per loop | Whole video | One, played once | Any | Any, free |
| Repeats | Yes | No | Yes | Yes |
| Any order | – | – | Yes | Yes |
| Code to write | None | None | About 20 lines | None |
| Shareable link | No | Yes | Your own page | Yes |
| Saved speed | No | No | If you add it | Yes |
Only need one part? See how to share a YouTube video with a start and end time. For using loops to learn a piece, see looping and slowing down for music practice.
Frequently asked questions
Can YouTube loop two different parts of a video?
No. YouTube's loop option repeats the whole video, and an embed link takes a single start and end, so it covers one stretch of the video and plays it once. Repeating two or more separate parts in a row needs either your own code using YouTube's IFrame Player API or a looper such as ClipBack.
Do the sections have to be in the same order as in the video?
No. The sections play in the order you put them in the list, so a chorus can come before the verse it follows in the song. Use the arrows next to each section to move it up or down.
How many parts can one loop have?
As many as you like, of any length.
Is there a gap when the loop jumps between sections?
There can be a short one. Each jump is a seek inside YouTube's player, and if that part of the video has not loaded yet the player has to buffer it first.
Can I add a section to a loop I already saved?
Yes: open the loop, click Edit Clip, and add, remove or reorder sections before you save.
Sources
- YouTube Help: Loop videos or playlists on YouTube
- YouTube Embedded Players and Player Parameters (
start,end) - YouTube IFrame Player API reference (
loadVideoById,seekTo,onStateChange)