Kodi Community Forum
Solved Boolean to check if browsing through a video addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Solved Boolean to check if browsing through a video addon (/showthread.php?tid=259884)



Boolean to check if browsing through a video addon - Hustler1337 - 2016-02-14

Hi,

I currently have an alarm clock function in DialogVideoInfo.xml which automatically launches a minimised trailer to play in the background and is shown on the screen through a small videowindow control. This is the code that I have:

PHP Code:
<onload condition="!IsEmpty(ListItem.Trailer) + IsEmpty(Window(10025).Property(PlayingBackgroundMedia))">AlarmClock(PlayTrailer,PlayMedia($INFO[ListItem.Trailer],false,1),00:30,silent)</onload

This works perfectly fine when browsing local video content, however, when I browse through media that has a trailer through a (legal) video addon and display the video info, the trailer is launched in full screen instead of being played in the background and viewed via the videowindow control as when browsing local video content.

I'm confused as to why this is happening and wanted to include a further condition to prevent the trailer from playing altogether if I am viewing a video information via a video addon.

Is this at all possible and if so, how can I do this? Or is there something I can do to prevent this strange behaviour?

Would appreciate any advice.

Thanks Wink


RE: Boolean to check if browsing through a video addon - Hitcher - 2016-02-14

PHP Code:
!SubString(Container.FolderPath,plugin://) 



RE: Boolean to check if browsing through a video addon - Hustler1337 - 2016-02-14

Hitcher, I could not thank you enough for sharing this. Works perfectly Big Grin Thank you once again, it's much appreciated.


RE: Boolean to check if browsing through a video addon - Hitcher - 2016-02-14

Actually this might be cleaner than a string compare -

PHP Code:
IsEmpty(Container.PluginName