Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
To embed a YouTube playlist, use an iframe URL with listType=playlist and your playlist ID. To start at a particular playlist item, use YouTube’s IFrame Player API and its zero-based index setting; the iframe’s start parameter instead chooses a time within a video.
Embed a YouTube playlist with an iframe
For a basic playlist player, put the playlist ID in the iframe URL’s list parameter and set listType=playlist. You do not need to put a video ID in the URL path.
| # | Preview | Product | Price | |
|---|---|---|---|---|
| 1 |
|
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM | $179.99 | Buy on Amazon |
| 2 |
|
Raspberry SC15184 Pi 4 Model B 2019 Quad Core 64 Bit WiFi Bluetooth (2GB) | $92.99 | Buy on Amazon |
| 3 |
|
Raspberry Pi 4 Model B, 2 GB. | $99.91 | Buy on Amazon |
| 4 |
|
CanaKit Raspberry Pi 4 4GB Basic Kit with PiSwitch (4GB RAM) | $149.99 | Buy on Amazon |
<iframe
width="640"
height="360"
src="https://www.youtube.com/embed?listType=playlist&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>
- Replace
PLAYLIST_IDwith the ID of the playlist you want to show. YouTube’s documented format says to prependPLto the playlist ID. - Paste the iframe into the HTML of the page where you want the player to appear.
- Preview the page and check that the player is large enough and that the playlist loads.
The dimensions above are an example. YouTube requires an embedded player viewport of at least 200 × 200 pixels and recommends at least 480 × 270 pixels for a 16:9 player with controls. YouTube’s embedded player parameters documentation covers the iframe URL and sizing constraints.
Start at a specific playlist video
The plain iframe parameters document how to load a playlist and set a timestamp, but do not document an arbitrary playlist-position parameter. To choose an item by its position, use the IFrame Player API. Its index is zero-based: 0 is the first item, 1 the second, and 2 the third.
Popular on Amazon
- Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM)
- Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
- CanaKit Premium High-Gloss Raspberry Pi 4 Case with Integrated Fan Mount, CanaKit Low Noise Bearing System Fan
- CanaKit 3.5A USB-C Raspberry Pi 4 Power Supply (US Plug) with Noise Filter, Set of Heat Sinks, Display Cable - 6 foot (Supports up to 4K60p)
- CanaKit USB-C PiSwitch (On/Off Power Switch for Raspberry Pi 4)
Load and play from the chosen item
After creating a YT.Player instance, call loadPlaylist with the playlist ID and the desired index:
player.loadPlaylist({
listType: 'playlist',
list: 'PLAYLIST_ID',
index: 2
});
This loads and plays the playlist starting with its third item. Change 2 to the required zero-based position. For a page that lets visitors choose an item, make the numbering clear—for example, show “Video 3” in the interface while passing index: 2 to the API.
Prepare the playlist without immediately playing
Use cuePlaylist with the same playlist and index when you want to queue the selected item without immediately requesting playback. Call playVideo() when playback should begin. You can also use playVideoAt(index) after a playlist has been loaded or cued to load and play the item at that zero-based position.
Also popular on Amazon
- Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1. 5GHz
- 2. 4 GHz and 5. 0 GHz IEEE 802. 11b/g/n/ac wireless LAN, Bluetooth 5. 0, BLE
- 2 × USB 3. 0 ports, 2 x USB 2. 0 Ports
- 2 × micro HDMI ports supproting up to 4Kp60 video resolution
- Micro SD card slot for loading operating system and data storage
The YouTube IFrame Player API reference documents playlist loading, queueing, and playback controls.
Start at a time within the selected video
Use the iframe’s start parameter to request a time in seconds from the beginning of the currently loaded video. With API playlist loading, startSeconds sets the time offset for the first video selected in the list. Neither parameter selects a playlist item: use index or playVideoAt(index) for that.
For example, a request to start at 90 seconds means 1 minute 30 seconds into the selected video, not the 90th video or a specific playlist position. YouTube may seek to a nearby keyframe, so playback can begin slightly before the requested second.
Also popular on Amazon
- Broadcom BCM2711 Quad Core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz
- 1GB, 2GB or 4GB 8GB-3200 SDRAM (depending on model).
- 2.4GHz and 5.0GHz IEEE 802.11ac Wireless, Bluetooth 5.0, BLE Gigabit Ethernet
- 2 USB 3.0 ports; 2 USB 2.0 ports.
- Raspberry Pi Standard 40 pin GPIO header (fully backward compatible with previous boards).
Configure API control and autoplay carefully
- If you enable JavaScript API control with
enablejsapi=1, set theoriginparameter to your website’s domain as an additional security measure. - Use
autoplay=1only when automatic playback is intended. YouTube’s parameter documentation says playback data collection and sharing occur upon page load when autoplay is enabled. - Check the player’s actual rendered viewport, not only the iframe attributes, to ensure it meets YouTube’s minimum size requirements.
Troubleshoot common problems
The embed does not show the intended playlist
Check that the URL includes both listType=playlist and the correct playlist ID in list. The documented playlist URL format does not require a video ID in the path.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteThe wrong video plays first
Confirm you are selecting a playlist item through the API, not using start or startSeconds. Also check the zero-based index: the third item is index 2, not 3.
Playback begins before the requested timestamp
This can happen because the player seeks to a nearby keyframe. A time offset is not guaranteed to be the exact displayed starting instant.
Also popular on Amazon
- Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM)
- CanaKit 3.5A USB-C Power Supply with Noise Filter (UL Listed) specially designed for the Raspberry Pi 4 (5-foot cable)
- CanaKit USB-C PiSwitch (On/Off Power Switch)
- Set of 3 Aluminum Heat Sinks for the Raspberry Pi 4
JavaScript API control does not behave as expected
If you enabled enablejsapi=1, include the origin parameter set to your site’s domain. Verify that the page is calling the API methods on the intended player instance.
The player is too small
Make sure the embedded viewport is at least 200 × 200 pixels. For a 16:9 player with controls, YouTube recommends at least 480 × 270 pixels.
Or let it run in the cloud
If your goal is a 24/7 YouTube channel playing uploaded documentaries rather than an embedded playlist on a webpage, StreamNeo keeps a YouTube stream running from the cloud: upload your video or build a playlist, add your YouTube stream key, and go live. Nothing has to stay on at home; it streams what you upload at its original quality up to 4K 60fps for one flat price per slot, and automatically recovers if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month. Start your free day with StreamNeo.






Say something about this film