Create a playlist on the fly, or play all videos in container?

I'm working on a channel which parses mp4 files from a website and plays them back.  I have the core of the channel working (you can browse the categories and play the videos), however, I'm looking for a way to create a playlist of sort, where the user can play all videos in a given category.

 

I haven't had much luck searching for a way to create an M3U file programmatically and return it, and the docs haven't turned up any way that I've found to return multiple videos.

 

Can anyone point me in the right direction?

Playlists are not currently supported.

Bummer.

So in theory, even if I had a playlist file (m3u, pls or whatever), Plex wouldn't play it back for me?

If you can create a m3u playlist file, that could work, since PMS does handle HTTP Live Streaming m3u8 playlists. All I meant was that there is not currently a simple way to build playlists. Any hack that one can come up with that works is likely to treat the entire playlist as a single media item for the purposes of metadata display etc.

I got this working today, but not the way I originally thought I would.  I'll posted it here in case anyone has a similar issue.

What I did was add a URLService that can handle the rss feed which I was using to populate the channel categories and add that as a video item (when there are videos in the category):

	if len(videoList) > 0:
		# add playlist item
		categoryUrl = feedUrl + "&quality=" + quality
		dir.add(VideoClipObject(
			url = categoryUrl,
			title = "Play All",
			summary = "Play all videos in '" + title + "'."
		))

Then in the URL Service, I check if the URL is actually a feed instead of a video, and if so, I create a media object with multiple parts, where each part is a video from the feed:

	mo = MediaObject(audio_channels = 2)

	for video in videoList:
		url = GetVideoUrl(video.ID, quality)
		mo.add(PartObject(key=Callback(DirectPlay, url=url)))
	
	return [mo]

Works exactly as I was hoping for.

Here's a link to the full code for anyone who's interested: http://code.google.com/p/mdryden-plex-addons/source/browse/trunk/TSN.bundle/Contents/Services/URL/TSN/ServiceCode.pys (It's not polished yet, don't judge me ;))

I see you have this working but I tried following it and just couldn't get it to work in my application.  If I have a list of YouTube url's, do you believe I can use the media object for each url to make a playlist?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.