setResolvedUrl() executes in one scenario, not in another - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: setResolvedUrl() executes in one scenario, not in another (/showthread.php?tid=377715) |
setResolvedUrl() executes in one scenario, not in another - hookum - 2024-05-27 Hi all, I am developing my addon, and running into a strange problem. The addon plays several streams, one after the other. Notice that both @plugin functions call play_video_source(). When this is done via the top function, play_video(), all is well, and the addon behaves as expected (calling xbmcplugin.setResolvedUrl() plays the videos). However, when execution travels through the second function, select_video_source(), setResolvedUrl() never executes (the videos don't play), although the logging lines above and below it do. What's going on here?! Code:
RE: setResolvedUrl() executes in one scenario, not in another - hookum - 2024-05-27 Ok, I've made a little progress. The variable __handle__ which in earlier code is Code: __handle__ = int(sys.argv[1]) is equal greater than 0 when the video DOES play (14, 19, etc.), and -1 when it doesn't. I am guessing this is my problem. So what is this argument, and where does it come from? EDIT: Even when passing in the handle manually, or hard-coding it to ex: 14, still does not play when returning from the Dialog(). Weird... EDIT #2: The function select_video_source() above is called thusly: Code:
RE: setResolvedUrl() executes in one scenario, not in another - hookum - 2024-05-28 Kept at it, and got it sorted. Thanks to this very helpful post. I simply changed Code: RunPlugin(...) to Code: PlayMedia(...) and problem solved. |