Skip to content

Instantly share code, notes, and snippets.

@jk0
Created September 24, 2012 14:10
Show Gist options
  • Save jk0/3776136 to your computer and use it in GitHub Desktop.
Save jk0/3776136 to your computer and use it in GitHub Desktop.
@route("/video/amazoninstantvideo/getvideoobject")
def GetVideoObject(url, video_type, title=None, summary=None, thumb_url=None):
thumb = Resource.ContentsOfURLWithFallback(url=thumb_url, fallback=PLUGIN_ICON_DEFAULT)
if video_type == "episode":
return EpisodeObject(key=Callback(VideoDetails, url), rating_key=url, items=video_items(url), title=title, summary=summary, thumb=thumb)
else:
return MovieObject(key=Callback(VideoDetails, url), rating_key=url, items=video_items(url), title=title, summary=summary, thumb=thumb)
@route("/video/amazoninstantvideo/videodetails")
def VideoDetails(url):
oc = ObjectContainer()
oc.add(VideoClipObject(key=Callback(VideoDetails, url=url), rating_key=url, items=video_items(url)))
return oc
def video_items(url):
return [
MediaObject(
parts=[
PartObject(key=Callback(PlayVideo, url=url))
]
)
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment