Android Need help for setResolvedUrl (Kodi 16)
#1
Hi All,

I have two video links: the first one is invalid link and the next one is a valid link.
When the invalid link fails, I try to play the next valid link but it does not work. I received the "Playback Failed" dialog, I can "see" my addon goes to play the next link but Kodi does not play the valid link.

My code:
  item.setPath(invalid_link)
  xbmcplugin.setResolvedUrl(handle=self.plugin, succeeded=True, listitem=item)
  xbmc.sleep(5000)
  if not xbmc.Player().isPlaying():
    # play the next valid link
    item.setPath(valid_link)
    xbmcplugin.setResolvedUrl(handle=self.plugin, succeeded=True, listitem=item)

But it works if I use xbmc.Player().play(valid_link, item) for the next valid link. I don't want to use xbmc.Player because it doesn't save the video status.

I guess that I have to reset "something" to make setResolvedUrl working again. Please help me to fix this issue.

Thanks a lot in advance for your help.
Reply
#2
You need to set IsPlayable = true when adding the directory item, prior to Kodi "redirection" to the method that sets the resolvedurl:

python:

item.setProperty("isPlayable", "true")
xbmcplugin.addDirectoryItem(....item...)

Btw, it is a bad practice to use such high sleep times (in xbmc.sleep), please use xbmc.Monitor().waitForAbort(secs) instead.
Reply
#3
Thanks enen92 for helping.
I already did the isPlayable = True.
My problem is if the first link is invalid, i.e the xbmc.Player cannot play the link and display the "Playback Failed" dialog, then my addon continue to use setResolvedUrl for the second valid link, the xbmc.Player does not work.
After fail to play the first link, if I use the xbmc.player to play directly the link, it will work but I don't have video status (Ex: No resume, no InProgress mark point etc ...)

Thanks for your help
Reply

Logout Mark Read Team Forum Stats Members Help
Need help for setResolvedUrl (Kodi 16)0