Can setResolvedUrl method call a plugin, if not, how should I call a plugin?
#1
Hi guys,

I hope this doesn't sound like a dumb question. I've done a fair bit of documentation reading and searching before I posted here, I promise.

So, I'm trying to scrape a site that lists episode like this:

- Episode 1
- Episode 2


Each episode links to a blog post with a Vimeo URL embedded in it.

So, I need to get the Vimeo ID for every episode, but I don't want to rape their servers every time someone displays all episodes in my plugin. What I want, is that when somebody clicks on an episode, the script makes a call to get the Vimeo ID and then opens the Vimeo plugin.

Right now I'm trying to do this unsuccessfully with setResolvedUrl:

vimeo_id = get_vimeo_id()
plugin_path = 'plugin://plugin.video.vimeo?action=play_video&videoid=' + vimeo_id
list_item = xbmcgui.ListItem(path=plugin_path)
list_item.setProperty('IsPlayable', 'true')
return xbmcplugin.setResolvedUrl(self.this_plugin, True, list_item)


But, of course, that's not the way setResolvedUrl works.

I know I can call an external plugin with addDirectoryItem but I can't populate the episode lists without the Vimeo ID.

Any advice you can give me friends, would be much appreciated.

Lex
Reply
#2
What you want is to poulate the UI with a list of items of Episode1 ,2 etc. This list contains links back to your plugin with the info you need to resolve the vimeo id. Once your plugin gets the call, you use the setResolvedUrl just as you described.
Look at my radbox code here. I use xbmc.executebuiltin("xbmc.PlayMedia("+url+")") in the playVideo method but I could have used setResolvedUrl instead...
Pneumatic | SABnzbd | XBMC that just works - openelec
Reply
#3
setResolvedUrl is used when the app does a callback on a playable plugin url, NOT when adding the playable plugin urls. in this case, the callback where setresolvedURL will be done is on the plugin://plugin.video.vimeo url, i.e. only vimeo needs to deal with setResolvedUrl
Reply
#4
Popeye, thanks heaps. I'll have a review of the code see if I can work it out. Might try executebuiltin instead.

spiff, same; thanks for taking the time to help me. Is there a way then to call the Vimeo plugin in a fashion similar to the way setresolvedURL calls playable media?
Reply
#5
Popeye. Reviewed the code. Very easy to read. I went with PlayMedia. Works a treat. Thanks heaps!
Reply
#6
i think you have misunderstood the point of setResolvedURL.

this is why it's there; many services have volatile urls, i.e. urls that are only valid for a short time. this raises the need to resolve the playback url just as video playback is started. this is achived through;
1) in the listing stage, the plugin returns a playable plugin:// url
2) when playback is started on that item, xbmc calls back to the plugin. the plugin then returns the actual url through a call to setResolvedURL, which the player then immediately opens and plays.
Reply

Logout Mark Read Team Forum Stats Members Help
Can setResolvedUrl method call a plugin, if not, how should I call a plugin?0