Playing video through content menu item
#1
Hi,

I want to add an option to the context menu, so the user can choose to play video transcoded. In my plugin, this is achieved by using a slight different URL for the video.

Under normal operation, a standard URL is used for the playable video item, this is then resolved to a media URL and played with setResolvedURL.

What I would like to do is, in a context menu item, alter the URL that is resolved slightly:

Code:
normal URL:    http://someserver/library/metadata/1&mode=20
transcode URL: http://someserver/library/metadata/1&mode=20&transcode=1

I've tried calling the URL directly in the context menu (using RunPlugin) but I get a handle problem (I can see it is discovered as -1).

I've also tried container.update(url) with and without ,replace and all I get is a blank listing (just the parent .. directory).

Any ideas how to start a play session from the context menu?


EDIT: This is on a pre-EDEN build btw
Reply
#2
Maybe this will help. See here - http://code.google.com/p/engadget-video-...default.py how I use 'RunScript' to call download and pass Kword args.
Reply
#3
divingmule Wrote:Maybe this will help. See here - http://code.google.com/p/engadget-video-...default.py how I use 'RunScript' to call download and pass Kword args.

Tried RunScript, but I get the same invalid handle error from setresolvedurl. Here are a number of different ways I've tried to get this to work:

Code:
u=sys.argv[0]+"?url="+str(url)
#transcodeURL="XBMC.RunPlugin("+u+"&transcode=1)"
transcodeURL="XBMC.RunScript("+PLUGINPATH+"/default.py, 0, ?url="+url+"&transcode=1)"
#transcodeURL="XBMC.RunScript("+PLUGINPATH+"/default.py, ?url="+url+"&transcode=1)"
print transcodeURL
#transcode="Container.Update("+u+"&transcode=1)"
context.append(("Play trancoded", transcodeURL, ))
Reply
#4
I have done this in plugin.video.nzbs
Code:
cm_url_download = sys.argv[0] + '?mode=' + cm_mode + url
        cm.append((cm_label , "XBMC.RunPlugin(%s)" % (cm_url_download)))
        listitem.addContextMenuItems(cm, replaceItems=False)

does, that help?
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#5
Sorry for the delay - but this hasn;t worked either. Still get an invalid handle.
The only way around this seems to be using Player().play() - but then I'm missing the title and stuff from the videoOSD.
Reply
#6
This post helped me. http://forum.xbmc.org/showpost.php?p=661...stcount=14 Thanks to HenrikDK.

Maybe try XBMC.PlayMedia
Reply

Logout Mark Read Team Forum Stats Members Help
Playing video through content menu item0