Skip to content
streamneo.
Setup Guides12 min read

How to Embed a YouTube Playlist and Start at a Specific Video

Embed a YouTube playlist, distinguish playlist position from video start time, and use the IFrame Player API to select an item.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

To embed a YouTube playlist on your website, use an iframe URL with the playlist ID. To begin at a particular video within that playlist, use YouTube’s IFrame Player API and its zero-based item index; the iframe’s start parameter instead sets a time within the selected video.

Those are two different choices: playlist position answers “which video?”, while a start time answers “where in that video?”. This guide shows both paths, including how to identify the playlist ID and avoid common indexing and playback surprises.

Choose a playlist item or an in-video start time

First decide whether you want to choose a video in the list or a moment inside a video. A plain playlist iframe can load a playlist, but its documented parameters do not select an arbitrary item by playlist position. For that, use the IFrame Player API. If you only need playback to begin at a particular second in the video that is loaded, use the supported start parameter for an iframe, or startSeconds when using the API.

For example, imagine a playlist of five lessons. If visitors should begin with the third lesson, you need to select the third playlist item. If they should begin two minutes into whichever lesson is selected, that is a timestamp. Combining the two is possible with the API: select an item by index and give its first playback position a time offset.

What you want Suitable approach Setting or call What it controls
Show a playlist player Iframe URL listType=playlist and list=PLAYLIST_ID Which playlist is loaded
Begin at a particular playlist position IFrame Player API index or playVideoAt(index) Which item in that list is selected
Begin part-way through a video Iframe URL or API start or startSeconds Time offset within the selected video
Queue a selected list before playback IFrame Player API cuePlaylist with index Which item is prepared, without immediately requesting playback

This distinction matters when you add a selector or link to a page. A label such as “Start at video 3” should map to a playlist position, not a timestamp of three seconds. Likewise, a “Start at 02:00” control should not be treated as an item number. Keep the two values separate in your page’s configuration.

The relevant YouTube player parameter reference documents playlist loading and in-video parameters. The IFrame Player API reference documents programmatic playlist selection and playback controls. Check those official pages when implementing, as the supported interface is the authoritative source.

Find the playlist ID

Open the playlist on YouTube and inspect its URL. A playlist URL commonly includes a list query value; the characters after list= are the playlist ID. Copy that value rather than the whole URL. For example, if the URL contains list=PL_example_value, the value to put into the embed configuration is PL_example_value.

You can also use YouTube’s Share or Embed flow to confirm that you are working with the intended playlist. Make sure you have selected the playlist itself, not merely an individual video that happens to be inside it. A video URL may include both a video identifier and a playlist identifier; the playlist ID is the value associated with list.

YouTube’s documented playlist embed format says to prepend the letters PL to the playlist ID. The practical result is that you should use the playlist identifier in the form expected by the official embed guide, and check the generated embed code if the playlist does not load. Do not assume the identifier of an individual video can substitute for the playlist ID.

Before publishing, test the ID in a page that you can edit. Confirm the player shows the expected list and that the first item is the one you expect when no specific item selection is being made. If the playlist is private, unavailable, or has changed since you copied its URL, visitors may not see the same content you see while signed in. Public access and availability are separate from the syntax of the iframe.

Embed the playlist with an iframe

For a basic playlist player, create an iframe whose source contains listType=playlist and list=PLAYLIST_ID. YouTube documents that this form does not need a video ID in the URL path. Replace the placeholder with your playlist’s actual ID:

<iframe
  width="640"
  height="360"
  src="https://www.youtube.com/embed?listType=playlist&amp;list=PLAYLIST_ID"
  title="YouTube playlist player"
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
  referrerpolicy="strict-origin-when-cross-origin"
  allowfullscreen>
</iframe>

The &amp; spelling is appropriate in HTML source: it represents the ampersand separating URL parameters. If you construct the URL in JavaScript, use the normal & character in the string and let the browser encode it as needed. Keep the iframe title meaningful for visitors using assistive technology, and make sure the dimensions fit your page layout.

This iframe is a good fit when the page simply needs to load and display a playlist. It does not provide a documented playlist-position parameter for telling the player to start at an arbitrary item. Do not add guessed parameters such as an item number and expect them to select an entry; use the API for that requirement.

The embedded player must have a viewport at least 200 by 200 pixels. For a 16:9 player with controls, YouTube recommends at least 480 by 270 pixels. On a narrow mobile layout, a fixed 640-pixel width can overflow. Use responsive CSS or your site’s responsive embed component, while preserving a usable player height and meeting YouTube’s minimum viewport requirement.

A playlist player is not the same thing as an always-on live broadcast. It is an embedded player visitors can use on a web page. If you are also planning a continuous YouTube channel, keep the website embed decision separate from the broadcast setup. For example, the practical considerations in this guide to looping videos in OBS without unnecessary CPU use concern a running broadcast, not selecting an item in an embedded playlist.

Set a start time within a video

To start an iframe video at a point in its playback, add start with a value in seconds. For example, adding &amp;start=120 asks the player to begin around two minutes into the currently loaded video. This setting does not mean “start at playlist item 120” and does not select a video in the playlist. It is only a time offset within the video that is selected or loaded.

For an API-controlled playlist, pass startSeconds when loading or cueing a playlist if you want a time offset for the first selected video. The API’s playlist index selects the item; startSeconds sets the playback position within that item. Treat them as two distinct inputs, particularly if the values come from a form or from page links.

A requested timestamp may not land on the exact frame or second. YouTube notes that seeking can resolve to a nearby keyframe, so a request for a particular moment can begin slightly earlier than requested. This is normal player behaviour rather than evidence that the playlist selection failed. If exact editorial timing matters, test the specific video and decide whether a nearby start is acceptable.

Avoid adding autoplay by default just because you can. YouTube documents autoplay=1 as starting the initial video automatically, and its player-parameter documentation notes that playback data collection and sharing occur on page load when autoplay is enabled. An autoplaying music or lesson playlist may be appropriate in a carefully designed experience, but on many pages a visitor-initiated play is less disruptive. Test the actual page in the context where it will appear rather than assuming browser behaviour will match a desktop preview.

If you enable JavaScript control with enablejsapi=1, YouTube advises setting the origin parameter to your website’s domain as an additional security measure. Use the origin of the page where the player is embedded, not a placeholder or an unrelated subdomain. If a site has both www.example.com and example.com, decide which address serves the page and configure and test that version.

Start at a specific playlist item with the IFrame Player API

Use the IFrame Player API when you need to choose a playlist item by position or control playback from page code. The API creates a player that your JavaScript can address. Once it is ready, call loadPlaylist with the playlist and the desired index. A minimal call looks like this:

player.loadPlaylist({
  listType: 'playlist',
  list: 'PLAYLIST_ID',
  index: 2
});

Replace PLAYLIST_ID with the actual identifier. This call loads and plays the selected list from the item at index 2, which is the third item because indexing starts at zero. Use loadPlaylist when playback should begin as part of the selection. The player still needs to be created and ready before you call its methods; a call made before the API reports that the player is ready will not reliably control it.

If you want the item prepared without immediately requesting playback, use cuePlaylist with the same playlist and index options. When the visitor chooses to begin, call playVideo(). That separation can be useful on a page with an explicit play button, or where the selection is made before the player should start. Do not rely on the cue operation to behave like an immediate play: it queues the content for later playback.

After a playlist has been loaded or cued, playVideoAt(index) selects and plays the item at that position. It is useful for a “next lesson” menu or a set of buttons tied to known entries. If your page also needs a start time, use the relevant API time offset separately; do not encode the offset as an index. The official IFrame Player API guide describes the playlist methods and player events, including the player-ready stage you should wait for.

API-controlled embeds take more work than a plain iframe. You need JavaScript on the page, a player instance, and a clear response to user actions and player state. If you only need visitors to browse and play the playlist, the basic iframe is simpler. If the site must select a particular item, the API is the documented approach, and the extra setup earns its place.

Use the zero-based index correctly

The API’s index is zero-based. That means index 0 selects the first item, index 1 selects the second, and index 2 selects the third. The value is a position in the playlist, not the video’s ID and not a time in seconds.

This is an easy place for a user interface to be off by one. Visitors usually describe a selection using ordinary counting: “the first video” or “video three”. If your control displays ordinary positions, convert the visitor-facing number to the API index by subtracting one. In code, an input of 3 for “third video” becomes index 2. Validate that the input is a positive position before converting it, and avoid passing a negative index if the user enters zero.

When you build a selector from playlist data, keep the displayed number and the API index distinct. For example, a displayed option may say “3 — Evening reading”, while the associated value is 2. This makes the code predictable and makes it easier to explain the selection to someone editing the page later. If the playlist order changes, a position-based selection may point to a different video, so revisit any hard-coded position after you rearrange the list.

Test with a playlist where you can recognise the beginning, middle, and end entries. Check that index 0 plays the first item and that a chosen later index starts at the expected entry. Then test any start-time behaviour separately. These small checks distinguish a wrong list ID, an off-by-one error, and a timestamp misunderstanding without adding complexity to the page.

For a page that combines a player with other live content, decide whether visitors need interaction with the playlist or merely a link to the broadcast. A page designed around a live programme has different controls and editorial needs; the discussion of adding polls and other interactions to a stream is about audience participation, not playlist item indexing. Keep the player’s purpose clear so visitors understand whether they are choosing an on-demand item or watching a live channel.

Test the page before publishing

Test from the page visitors will use, not only from a local code snippet. Confirm the playlist ID resolves, the player fits on desktop and mobile, and the expected item is selected. If you use the API, test the ready state, the selected index, and any start-time offset as separate behaviours. Also test the page while signed out if the playlist needs to be available to general visitors.

Check that the controls and page copy match the behaviour. If a button says “Play third video”, it should select the third item rather than start the first item three minutes in. If the copy promises a timestamp, test that offset on the selected item and allow for the nearby-keyframe behaviour. Where visitors may have different devices or browser settings, avoid claiming an exact start frame or automatic playback experience that you have not verified.

If this embed is part of a wider streaming setup, keep the scope of each tool clear. A website iframe plays YouTube content on that page; it does not keep a separate live broadcast running. For a continuous prerecorded channel, you may need to consider the operating model separately, as in this comparison of OBS and other approaches for looping prerecorded videos. StreamNeo removes the need to leave your own computer running when a prepared video needs to run as a continuous YouTube broadcast, which is a different problem from embedding a playlist on a website.

Finally, revisit the official documentation if the implementation will be maintained over time. The player parameter page is the place to check supported iframe URL settings; the IFrame Player API reference is the place to check playlist methods, events, and index behaviour. Avoid relying on forum snippets that assign undocumented meaning to a URL parameter.

Before committing, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.

FAQ

Can a plain playlist iframe start at the third video?

The documented playlist iframe parameters load a playlist, but do not specify an arbitrary playlist item by position. Use the IFrame Player API with index: 2 or playVideoAt(2) for the third item. Do not treat an undocumented iframe parameter as a supported selector.

Does start=120 select the second item?

No. The iframe start parameter is a time offset in seconds within the video that is loaded. For a playlist item selection, use the API’s zero-based index; startSeconds can then specify a time offset within that selected video.

Why does my requested start time appear slightly early?

YouTube may seek to a nearby keyframe rather than the exact requested second. This can make playback begin a little before the timestamp you supplied. Test the actual video if the point in the recording matters closely.

What should I check if the API embed does not behave as expected?

Wait until the player is ready before calling playlist methods, check that the playlist ID is correct, and confirm that the index is zero-based. If JavaScript API control is enabled, set the origin to the website’s domain and test from the published page.

YOU’VE REACHED THE END

Keep the ideas coming.

More guides, useful tools and a little help for your next broadcast.

Back to the journal ↗
YOUR NEXT READ

A little more to explore.

More Setup Guides guides ↗ · All topics ↗