I don’t know if it helps, but here’s an output structure from another channel that doesn’t play video streams, but just files. By “structure” I mean simplified YAML-ish syntax and stripped of non-essential attributes like ‘title’, ‘summary’ and so on.
Directory (menu):
ObjectContainer:
- MovieObject: # oc.add(MovieObject(...))
key: Callback(PlayVideo, url=movie_url)
rating_key: movie_url
items: CreateMediaObjectsForURL(Callback(PlayVideo, url=movie_url))
CreateMediaObjectsForURL(callback) (not from URL Service, just similarly named function in Code/__init__.py, could just as well may be, but then Plex matches menu content to URL Services a bit differently and the menu structure should be adjusted as well; also based on the function name it should actually take URL, not callback, but I found it convenient since it just passes the callback down to the PartObject):
- MediaObject: # function returns array
parts:
- PartObject(key=callback)
Note: the function returns array, may contain more than one MediaObject.
PlayVideo:
def PlayVideo(movie_url):
# actual call to a function `CreateVideoObjectContainer`
return CreateVideoObjectContainer(movie_url)
Note: creating video object container should be in its own function because it’ll include a callback to itself.
CreateVideoObjectContainer(movie_url)
ObjectContainer:
no_cache: true
objects: # `objects` attribute is array containing a `VideoClipObject`
- VideoClipObject:
key: Callback(CreateVideoObjectContainer, movie_url=movie_url) # callback to self
rating_key: movie_url
items:
- MediaObject:
parts:
- PartObject:
key: key=Callback(RedirectToActualVideoUrl, movie_url=movie_url)
RedirectToActualVideoUrl:
def RedirectToActualVideoUrl(movie_url):
movie = WebsiteMoviePage(movie_url)
video_url = movie.video_url
Log('Redirecting to video URL: %s' % video_url)
return Redirect(video_url)
May be overcomplicated, in part due to the fact I didn’t use URL Services here, but seems to be working for me.