Playback

For playback in your browser or on your mobile device, the easiest and most comfortable way is to use the media player. It supports playback of all videos in a single playlist. If you have a headset or keyboard with media keys, those should work too. The playback list repeats indefinitely, and additionally can be shuffled. The shuffle algorithm guarantees that every item plays exactly once before the list is reshuffled.
Note that the playlist information is cached for an hour to not bug the YouTube API too much.

Streaming

Manual streaming is recommended if you want to stream videos and/or playlists as a single continuous MP3 file. It's also the way to go if you want to stream on a web radio device.

The streaming system operates on the video ids and playlist ids. They both can be grabbed from the address bar of your browser on every youtube video.
The easiest way to use it is to use the URL builder, but you can also look at the API yourself.

Restrictions

You can only stream videos and playlists that can be viewed publicly and are not age restricted. The administrator of this system may also put restrictions in place about the video length or the number of videos in a single stream.
You can stream content that is public but unlisted.

Stream keys

The operator of this system has disabled anonymous streaming. For the stream URLs to work you either have to be logged in, or add a stream key to the URL. Visit your key management page to get keys.

Video id

The video id is an 11 character string following the v= of a video URL.
Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ

Playlist id

The playlist id comes in two versions depending on how old the playlist is. Both of them are fairly long and can be identified because they start with "PL"
Format: https://www.youtube.com/playlist?list=PL<many_characters>

Multiple ids

You can supply multiple ids to a stream function to stream them as a single audio stream. Use commas to separate them in the URL.
You can supply the same id multiple times to repeat it. Playlist ids and video ids can be mixed.