Mod Cancel setResolvedUrl
#1
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
Reply
#2
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.wherea...you.py#L66

(in case the link doesn't take you to the exact line, look the stuff starting at line 66)
Reply
#3
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?
Reply
#4
(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.
Reply
#5
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.
Reply
#6
As an alternative:
xbmcplugin.setResolvedUrl() has a parameter called "success". You can set it to False and use an empty ListItem with the function. Even if that will generate a failure popup dialog (I don't remember if it does), that's the proper way to "cancel" the execution cycle for a setResolvedUrl().
Reply
#7
(2024-12-26, 02:19)doko-desuka Wrote: As an alternative:
xbmcplugin.setResolvedUrl() has a parameter called "success". You can set it to False and use an empty ListItem with the function. Even if that will generate a failure popup dialog (I don't remember if it does), that's the proper way to "cancel" the execution cycle for a setResolvedUrl().

I use this method as well, and it is the correct way to end a failed setResolvedURL... no pop-up dialog.

python:
xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, xbmcgui.ListItem())
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply
#8
Amazing.
I used setResolvedUrl() with False and movie item, not empty. I this case notification (error dialog) was often presented.
With empty ListItem I can see no notification...

It's not true – after 30 sec. the notifications appears again.
It seams there is only a timeout to do not spam a notification.

@Lunatixz – could you resume a video and cancel it, wait a minute a and repeat resume and cancel?
Reply
#9
It's not a timeout or something. There is a race. Sometime Kodi try to start video sometime not (stops before start). Never mind.

Summarize:
  • setResolvedUrl(success=False) – the best way but annoying
  • resolve with empty list if starts from begging 
  • resolve with long-long-video if resume and stop immediately – can blink single frame (if AVStart is fast enough).


Thanks for your help.

P.S. I don't know how to mark the thread as "solved".
Reply

Logout Mark Read Team Forum Stats Members Help
Cancel setResolvedUrl0
This forum uses Lukasz Tkacz MyBB addons.