Posts: 402
Joined: Apr 2008
Reputation:
1
Temhil
Skilled Python Coder
Posts: 402
Hi,
In order to optimize a plugin, I was thinking to retrieve the directory Item video in a separate thread. The problem is in the plugin API we have the addDirectoryItem function, but I didn't find a wait to modify the URL once an ListItem has been added.
Is it possible?
Also it is not clear to me what is the role of the setResolvedUrl() functionm could someone explain that to me?
Thank you in advance.
Posts: 26,215
Joined: Oct 2003
Reputation:
187
Yes, the above will alter the path.
setResolvedURL is used ONLY for returning the playback URL once XBMC has re-run your plugin to resolve a URL prior to playback.
Cheers,
Jonathan
Posts: 26,215
Joined: Oct 2003
Reputation:
187
Nope. It's this scenario:
1. You give us a list of videos, but the URLs of those videos need to be resolved directly before playback, not on listing (eg they use a URL which times out after a while, or some cookie, or require quite a lot of processing to determine the real URL).
2. Thus, you instead provide the URL of the video as a link back to your plugin (with isFolder set to false).
3. When the user clicks on a file XBMC calls your plugin.
4. Your plugin then figures out the real URL of the video and calls setResolvedUrl().
5. XBMC plays the real URL.
Cheers,
Jonathan
Posts: 26,215
Joined: Oct 2003
Reputation:
187
Reason is the item is copied when you addDirectoryItem, thus when you update your copy it doesn't change the one that was added. Nothing you can do about that.
Posts: 2,710
Joined: Feb 2009
Reputation:
12
ppic
Skilled Python Coder
Posts: 2,710
don't you need to refresh container?
Posts: 26,215
Joined: Oct 2003
Reputation:
187
setResolvedUrl() likely won't do anything at all for executable content.