Kodi Community Forum

Full Version: Boolean to check if browsing through a video addon
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
PHP Code:
!SubString(Container.FolderPath,plugin://) 
Hitcher, I could not thank you enough for sharing this. Works perfectly Big Grin Thank you once again, it's much appreciated.
Actually this might be cleaner than a string compare -

PHP Code:
IsEmpty(Container.PluginName