Currently, if you generate an embed code for a playlist on the
playlist's YouTube.com page, the code consists of an <object>/<embed>
tag combination. We will soon be transitioning to an alternative
default format for playlist embed codes generated on YouTube.com. The
code will look like
<iframe width="560" height="349" src="http://www.youtube.com/embed/
videoseries?list=PL[PLAYLIST_ID]" frameborder="0" allowfullscreen></
iframe>
For those who have used our single-video <iframe> embed codes, this
should look very familiar. In place of the standard video id is the
text "videoseries", which is 11 characters long, like our current
video ids. The actual playlist id is passed in as the URL query
parameter "list".
We are aware that some developers who code publishing/blogging
platforms have whitelists in place to allow only specific <iframe>
embed codes. Because the new playlist player <iframe> embed adheres
closely to the existing single-video <iframe> embed code, in most
cases nothing will need to be done to add support for them. To
confirm, we ask that anyone who does employ a whitelist of allowed
<iframe> URLs test out their code to ensure
http://www.youtube.com/embed/videoseries?list=PL[PLAYLIST_ID] will be
accepted. Our recommended practice for whitelisting YouTube <iframe>
embed codes is to use the following regular expression on the src
attribute, with case-insensitive matching:
^https?://([\w-]+\.)*youtube\.com/embed\b.*
This regular expression will match our current YouTube <iframe>
embeds, and should be flexible enough to match future variations on
the <iframe> embed URLs.
Cheers,
-Jeff Posnick, YouTube API Team
apiblog.youtube.com | @YouTubeDev | groups.google.com/group/youtube-
api-gdata