Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 15
  • 16
  • 17(current)
  • 18
  • 19
  • 22
Release Execute user tasks for Kodi events (callbacks ver2)
The "onPlayBackStarted" event on leia seems to be called once after reboot, after that it's not called anymore.
Is this a Leia bug or an addon bug? Would be nice to get an update.
The "onPlayBackResumed" event works fine, so I need to pause and resume every video, as this calls the same smarthome functions here.

Best regards,
Marc
Reply
The fact is that kodi Callbacks is no longer working on Leia and it seems that KenV99 has abandoned the project. So we have to hope that someone takes the KenV99 project.
Reply
Leia. What’s this crash is about?

2019-03-13 18:22:46.963 T:3186619248 NOTICE: $$$ [kodi.callbacks] - Settings read
2019-03-13 18:22:46.965 T:3186619248 NOTICE: $$$ [kodi.callbacks] - Dispatcher initialized
2019-03-13 18:22:46.970 T:3186619248 NOTICE: $$$ [kodi.callbacks] - Subscriber for event: onPlayBackStarted, task: T1 created
2019-03-13 18:22:46.977 T:3186619248 NOTICE: $$$ [kodi.callbacks] - Player Publisher initialized
2019-03-13 18:22:46.981 T:3186619248 NOTICE: $$$ [kodi.callbacks] - Dispatcher started
2019-03-13 18:22:46.984 T:3186619248 NOTICE: $$$ [kodi.callbacks] - Publisher(s) started
2019-03-13 18:22:57.971 T:4094574512 NOTICE: VideoPlayer::OpenFile: videodb://inprogresstvshows/94/-2/1995?season=-2&tvshowid=94
2019-03-13 18:22:57.972 T:3151532912 NOTICE: Creating InputStream
2019-03-13 18:22:57.975 T:3151532912 NOTICE: Creating Demuxer
2019-03-13 18:22:57.994 T:3171939184 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.IndexError'>
Error Contents: list index out of range
Traceback (most recent call last):
File "/storage/.kodi/addons/script.service.kodi.callbacks/resources/lib/publishers/player.py", line 331, in onPlayBackStarted
self.getInfo()
File "/storage/.kodi/addons/script.service.kodi.callbacks/resources/lib/publishers/player.py", line 267, in getInfo
playerid = player['result'][0]['playerid']
IndexError: list index out of range
-->End of Python script error report<--
Reply
(2019-03-13, 17:24)i3laze Wrote: What’s this crash is about?

Without really knowing the plugin or your configuration it looks like no player could be loaded from the configuration. Whatever a player may be here...

You could try to edit line 269 in file /storage/.kodi/addons/script.service.kodi.callbacks/resources/lib/publishers/player.py into
except (IndexError, KeyError):
instead of
except KeyError:

Maybe this helps.
Reply
Here's the deal.. /storage/.kodi/addons/script.service.kodi.callbacks/resources/lib/publishers/player.py Line 258:
python:
while tries < 8 and self.isPlaying() is False:
   xbmc.sleep(250)

Seems isPlaying() returns True (thus no delay occurs), but player actually haven’t initialized yet.

I've added extra xbmc.sleep(1000) delay below and now JSON-query returns Player data successfully.
Eventually Callbacks then fires tasks.

P.S. Warnings in log are related to add-on config parsed badly.. it also affects add-on Settings displayed crappy.
Reply
So, I changed xbmc.sleep to (1000). Now it will reliably update the status when watching anything on the PVR (Myth), it will sometimes update the status when starting a TV show, but it will never update the status when starting a movie. I'm stumped.
Reply
Hello,

I'm trying too to use the "onPlayBackStarted" event but it doesn't work well...

But I identified a systematic behavior : it works ONLY when you run a video that interrupts another one playing.

if you start a video with no video playing in background, it doesn't work.

If this can help someone to debug the plugin, it would be very helpful !!

Thanks
Reply
I have a little question by the way, I'm not sure to understand well how this addon works.

When I choose "onPlayBackStarted", I can only transmit the variables that are listed below ?
(%li, %wi, %fn, %ti,...)

Or I can transmit another variable ?
I need to transmit the information of number of channels of the media playing (2.0 or 5.1 for example)

Is it possible with this add-on ?
Reply
OK,

I was able to do it with a python script with the line :

NbreCanaux = xbmc.getInfoLabel('VideoPlayer.AudioChannels')

No need for variable substitution... and I realize that thanks to that wonderful addon, I think it's possible to access to almost anything in Kodi !!

Now If someone can fix that little bug (post #247), that would be amazing Smile
Thanks
Reply
@KenV99 are you still around ? any plan on fixing the addon for Leia ?
Reply
Hoping someone here can help me with some basic use. I'm trying to use callbacks to play background music in the menus and pause/play when I start stop a movie.

I started trying to to use a builtin command like this..

PlayMedia(C:/Media/Music/LondonSymphonyOrchestra/JohnWilliamsALifeInMusic,[isdir:
)]

and although I don't get any errors, I also don't hear any music either. Do I have my syntax wrong?
Reply
uhmmm, I guess I can't edit posts, here is my command to try and play songs in a directory..

PlayMedia(C:/Media/Music/LondonSymphonyOrchestra/JohnWilliamsALifeInMusic,[isdir])
Reply
(2019-03-22, 22:09)jeffkjolley Wrote: So, I changed xbmc.sleep to (1000). Now it will reliably update the status when watching anything on the PVR (Myth), it will sometimes update the status when starting a TV show, but it will never update the status when starting a movie. I'm stumped.

Looks like the “while tries < 8“ doesn’t fire in Leia at all.
So it’s not about changing but adding extra line with xbmc.sleep(1000).
Try also 2000 (2 sec) or more - maybe your CPU is a bit choking on playback start.
Reply
(2019-04-08, 06:42)i3laze Wrote:
(2019-03-22, 22:09)jeffkjolley Wrote: So, I changed xbmc.sleep to (1000). Now it will reliably update the status when watching anything on the PVR (Myth), it will sometimes update the status when starting a TV show, but it will never update the status when starting a movie. I'm stumped.

Looks like the “while tries < 8“ doesn’t fire in Leia at all.
So it’s not about changing but adding extra line with xbmc.sleep(1000).
Try also 2000 (2 sec) or more - maybe your CPU is a bit choking on playback start. 
Not working here unfortunately...
Tried with several values, till 5000....
Nothing happens when a video starts.

BUT as I mentioned in #247, it ALWAYS works when a video interrupts another !
Reply
(2019-04-08, 22:26)badsheep Wrote: Not working here unfortunately...
Tried with several values, till 5000....
Nothing happens when a video starts.

BUT as I mentioned in #247, it ALWAYS works when a video interrupts another ! 
 Can confirm. I've tried all suggested workarounds and can only get the callback to fire by starting a video while one is already playing. Very weird.
Reply
  • 1
  • 15
  • 16
  • 17(current)
  • 18
  • 19
  • 22

Logout Mark Read Team Forum Stats Members Help
Execute user tasks for Kodi events (callbacks ver2)3
This forum uses Lukasz Tkacz MyBB addons.