Kodi Community Forum
Closing DialogBusy.xml - 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: Closing DialogBusy.xml (/showthread.php?tid=347083)



Closing DialogBusy.xml - firewater - 2019-09-08

I'm trying to show a loading image when the video is loading, but because I use an external player, DialogBusy.xml isn't triggered.

Since I open videos from a DialogVideoInfo.xml button, I added DialogBusy to open there:

xml:
                <control type="button" id="97">
                    <onclick>ActivateWindow(busydialog)</onclick>
                    <onclick>SendClick(8)</onclick>
                </control>

The problem is once I exit the video, back on the item list, I've lost all control of the list no matter what I press, and I have to quit Kodi.

My DialogBusy.xml is just:

xml:
<?xml version="1.0" encoding="UTF-8"?>
<window>
    <controls>
        <control type="multiimage">
            <animation effect="fade" end="100" start="0" time="200">WindowOpen</animation>
            <animation delay="100" effect="fade" end="0" start="100" time="200">WindowClose</animation>
            <imagepath>general/background.png</imagepath>
            <aspectratio>stretch</aspectratio>
            <visible>Player.Playing</visible>
        </control>
    </controls>
</window>

So how do I make it close? Or have control back on the list? Or even just load the image directly from the onclick instead of adding a DialogBusy.xml window?


RE: Closing DialogBusy.xml - jurialmunkey - 2019-09-08

Don't use the busy dialog window. Just fake it by putting your multiimage busy control in DialogVideoInfo and use visibility conditions:

xml:

<onclick>SetProperty(FakeBusyDialog,1,Home)</onclick>
<onclick>SendClick(8)</onclick>

xml:

<control type="multiimage">
<animation effect="fade" end="100" start="0" time="200">WindowOpen</animation>
<animation delay="100" effect="fade" end="0" start="100" time="200">WindowClose</animation>
<imagepath>general/background.png</imagepath>
<aspectratio>stretch</aspectratio>
<visible>!String.IsEmpty(Window(Home).Property(FakeBusyDialog))</visible>
</control>

In VideoFullScreen.xml add an <onunload> condition to clear the property when it closes:
xml:

<window>
<onunload>ClearProperty(FakeBusyDialog,Home)</onunload>
<controls>



RE: Closing DialogBusy.xml - firewater - 2019-09-08

Thanks for the help. This feels right, but it's not working for me. I suspect it's because DialogVideoInfo closes with SendClick(8) - is there a way for it not to? But even then, I put the image on the Viewtype_List instead, and it doesn't show up still. I think the visibility condition for the image should be something else, the way I read this it seems it would appear when the string is empty, which is then when VideoFullScreen exits, but it should be when it loads up? I may be confused. But I tried a bunch of combinations and I can't get it to work.

My VideoFullScreen is just the following:

xml:
<?xml version="1.0" encoding="UTF-8"?>
<window>
    <onunload>ClearProperty(FakeBusyDialog,Home)</onunload>
    <controls>
    </controls>
</window>



RE: Closing DialogBusy.xml - jurialmunkey - 2019-09-08

(2019-09-08, 22:53)firewater Wrote: Thanks for the help. This feels right, but it's not working for me. I suspect it's because DialogVideoInfo closes with SendClick(8) - is there a way for it not to? But even then, I put the image on the Viewtype_List instead, and it doesn't show up still. I think the visibility condition for the image should be something else, the way I read this it seems it would appear when the string is empty, which is then when VideoFullScreen exits, but it should be when it loads up? I may be confused. But I tried a bunch of combinations and I can't get it to work.

My VideoFullScreen is just the following:

xml:
<?xml version="1.0" encoding="UTF-8"?>
<window>
    <onunload>ClearProperty(FakeBusyDialog,Home)</onunload>
    <controls>
    </controls>
</window>

Oh I misunderstood what you were trying to do.

DialogBusy.xml should show automatically while the video is loading. You shouldn't need to call it or do anything. Just remove your visibility condition in the multiimage in DialogBusy.

Here is AZ2 showing DialogBusy.xml onclick of button id="8" in info dialog. I'm not doing anything special here at all - Kodi just shows the dialog automatically.
https://www.youtube.com/watch?v=6VGJM2EQS9I


RE: Closing DialogBusy.xml - firewater - 2019-09-09

Oh! It does feel like your code is a line away from doing what I need though. DialogBusy indeed loads for me like you demonstrate, but it does not when I use an external player - which is all the time. I realize now your code doesn't work because VideoFullscreen is never loaded, as it's skipped along DialogBusy in favor for the external player. So I need a way to load the loading image from DialogVideoInfo, then open the video with SendClick(8), and then disappear the image when Player.Playing is false.


RE: Closing DialogBusy.xml - jurialmunkey - 2019-09-09

(2019-09-09, 01:37)firewater Wrote: Oh! It does feel like your code is a line away from doing what I need though. DialogBusy indeed loads for me like you demonstrate, but it does not when I use an external player - which is all the time. I realize now your code doesn't work because VideoFullscreen is never loaded, as it's skipped along DialogBusy in favor for the external player. So I need a way to load the loading image from DialogVideoInfo, then open the video with SendClick(8), and then disappear the image when Player.Playing is false.

Ah I missed the bit about external player.

You could try using a custom window as a fake busy dialog with a visibility condition for the whole window (before the <controls> tag)