Kodi Community Forum
Mod Cancel setResolvedUrl - 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: Mod Cancel setResolvedUrl (/showthread.php?tid=379869)



Cancel setResolvedUrl - rysson - 2024-12-22

Hi,

is any way to cancel setResolvedUrl() without a notification about play failed?

When Kodi as my plugin about URL I ask the user if he wants to buy VoD. If he press NO then I set setResolvedUrl(handle, False).
The notification is not necessary, user abort access to the video himself.

How to disable the notification?

Regards,
rysson


RE: Cancel setResolvedUrl - pkscout - 2024-12-23

I don't think you can bypass the playback failed notification unless you play *something*  I got around this with an addon I wrote by including a very short mp4 file that is just a black screen.  When I need to get out of things without the playback failed notification, I play that little mp4.  To the user the screen goes black for like 3 seconds (you could probably get away with something shorter) and then returns to the GUI.

https://github.com/pkscout/plugin.whereareyou/blob/7f2bb053ec94f0c2be61d834d225f197d63ec288/resources/lib/whereareyou.py#L66

(in case the link doesn't take you to the exact line, look the stuff starting at line 66)


RE: Cancel setResolvedUrl - rysson - 2024-12-23

Thanks for quick answer.

I've tried the same, even with empty m3u8 playlist to avoid blinking but I have a problem with watched mark.
If the video has process set, playing something short marks as watched.
How do you handle it?


RE: Cancel setResolvedUrl - pkscout - 2024-12-23

(2024-12-23, 10:39)rysson Wrote: Thanks for quick answer.

I've tried the same, even with empty m3u8 playlist to avoid blinking but I have a problem with watched mark.
If the video has process set, playing something short marks as watched.
How do you handle it?
Oddly, I've not had that issue.  My addon is really kind of hijacking the playback mechanism to let you use .disc files as placeholders that generates a dialog box telling you what streaming service it's available on (or a strm file with a URL that I can process via Home Assistant - that's a longer story).  I didn't do anything special to keep the watched mark from getting enabled.


[SOLVED] Cancel setResolvedUrl - rysson - 2024-12-24

OK, a have made more tests.
It looks Kodi try to rewind to resume point. If black.mp4 (or m3u list) is shorter, Kodi marks the video as watched.
If black.mp4 is longer, just starts playing. 

If I stop playing just after setResolvedUrl() it blinks black frame (not always) and stops. And does NOT change the resume point!

In this way I can say that problem is solved.
Thanks for your help.