enen92 / screensaver.atv4

Apple aerial screensavers (apple tv 4) for Kodi
GNU General Public License v2.0
52 stars 10 forks source link

Screensavers look to other plugins like playing videos #15

Closed tremby closed 7 years ago

tremby commented 7 years ago

script.kodi.hue.ambilight dims my lights when the screensaver starts, which is far from ideal. Is there any way to avoid this?

enen92 commented 7 years ago

Guess I have a lot to do in this plugin when I have some free time :) Either way this is something that has to be "fixed" in script.kodi.hue.ambilight. I can see if I come up with a solution to the problem though.

tremby commented 7 years ago

Well presumably it's detecting that a video has started playing. So I'm wondering what sort of signals are sent out when a regular screensaver is sent out, and what signals are sent out when this one starts.

enen92 commented 7 years ago

It's doable, basically the service addon has to detect the onScreensaverActivated() event (https://codedocs.xyz/xbmc/xbmc/group__python__monitor.html#ga12654f86c682619219dd84acb74ae429) and check if the enabled screensaver addon is either screensaver.atv4 our videoscreensaver (I think those are the only screensaver addons that use video). The logic is the same on both screensavers, they just catch the onScreensaverActivated() event, perform some action to trigger onScreensaverDeactivated()and start the video loop afterwards. So the service has to check for a specific time elapsed between both events (deactivate and playback started). It it helps, I can just define a skin property when the video is started by screensaver.atv4and remove it when the playback is stopped. That way, any service addon that executes logic when a video starts can check for the existence of the given property.

tremby commented 7 years ago

I take it there's no way to work around it on your end and somehow suppress the "video is playing" signals from getting out?

enen92 commented 7 years ago

Nop, that can't be controlled through the addon. It just pipes videos to the videoplayer. I can work out on the skin property though. That should be fairly easy to implement on ambilight side.

tremby commented 7 years ago

I don't know Kodi plugin development; once you know what's necessary on their end perhaps you could post a message to the ticket I referenced on their repository above? Thanks so much.

enen92 commented 7 years ago

Yap, I'll have a look. However pretty busy till the end of the month. A pity I don't have a hue myself otherwise I would send the "fix" myself

enen92 commented 7 years ago

@tremby found some time to check the code again and it is in fact pretty easy to solve (on the service addon side) as it is. They just have to create a new setting to "ignore video screensavers" and use the following boolean conditions to check if either screensaver.atv4 or screensaver.video:

if not xbmc.getCondVisibility('Window.IsActive(screensaver-atv4.xml)') and not xbmc.getCondVisibility('Window.IsActive(screensaver-video-main.xml)')

Will post on your other issue as well to see if they can pick it up

enen92 commented 7 years ago

This is fixed on their side

tremby commented 7 years ago

Yup. Thanks!