x-key (Stop playback) behaviour.
#1
Why does the x-key on the keyboard behave differently on fullscreen playback and windowed playback ?

With fullscreen movie or trailer :
  • The movieinformation screen is closed
  • The trailer or movie playback starts in fullscreen
Hitting the x-key to stop playback behaves like this :
  • stops the video
  • removes the video from the player
  • returns to the screen that was displayed prior to the movieinformation screen (because it was removed just before playback started)

With windowed movie or trailer :

New xml file custom_1190-Trailer.xml :
Code:
<window type="dialog" id="1190">
...
<control type="videowindow" id="510">
  • The movieinformation screen is NOT closed
  • The trailer or movie playback starts windowed in the videowindow control (overlayed over the movieinformation screen)
Hitting the x-key to stop playback behaves like this :
  • stops the video
  • removes the video from the player
  • hides the group control containing the videowindow control
  • the custom dialog window (1190) is now completely transparant and the movieinformation window is fully visible (not covered/overlayed by anything)
  • the buttons and keys of the movieinformation screen are inaccessible
  • does NOT return to the movieinformation screen. The custom window (1190) is still active (skin.ToggleDebug confirms this)
  • the Esc-key, Backspace-key, or right-click of mouse is required to return to the movieinformation screen and gain control over its buttons and keys

Why ?

EDIT: Everything else works as expected just not the x-key on the windowed screen.
Reply
#2
Because FullscreenVideo.xml needs to have a video to be open, so stopping the video closes the window. You would expect this happen as it would make no sense to keep open a blank screen when stopping the video.

With a custom dialog you would need some condition to close it. Custom windows have other uses than playing videos. Why would a custom window close when stopping a video? That would ruin them for every other scenario they are used for.

In the custom window, in between the <window> and <controls> tag put a visibility condition.

e.g.
Code:
<window type="dialog" id="1190">
    <visible>Player.HasVideo</visible>
    <controls>
        <control type="videowindow" id="510">
...


EDIT: I just realised you might want to be able to specifically call the window. If so, use a window property as well

e.g.
Code:
<window type="dialog" id="1190">
    <visible>Player.HasVideo + !String.IsEmpty(Window(Home).Property(visible_1190))</visible>
    <onunload>ClearProperty(visible_1190,Home)</onunload>
    <controls>
        <control type="videowindow" id="510">
...

And when you want to call the window use:
Code:
<onclick>SetProperty(visible_1190,1,home)</onclick>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
(2017-09-13, 00:04)jurialmunkey Wrote: Because FullscreenVideo.xml needs to have a video to be open, so stopping the video closes the window. You would expect this happen as it would make no sense to keep open a blank screen when stopping the video.

Keeping open a blank screen is exactly what happens when pressing the x-key. Quoting myself :
(2017-09-12, 16:46)Luke Cage Wrote: ...

With windowed movie or trailer :

...

Hitting the x-key to stop playback behaves like this :
  • ...
  • ...
  • ...
  • the custom dialog window (1190) is now completely transparant and the movieinformation window is fully visible (not covered/overlayed by anything)
  • ...
  • ...
  • ...

...


(2017-09-13, 00:04)jurialmunkey Wrote: With a custom dialog you would need some condition to close it. Custom windows have other uses than playing videos. Why would a custom window close when stopping a video? That would ruin them for every other scenario they are used for.

To answer your question "Why would a custom window close when stopping a video?" I'm quoting myself :
(2017-09-12, 16:46)Luke Cage Wrote: ...

With windowed movie or trailer :

...

Hitting the x-key to stop playback behaves like this :
  • stops the video
  • removes the video from the player
  • hides the group control containing the videowindow control
  • the custom dialog window (1190) is now completely transparant and the movieinformation window is fully visible (not covered/overlayed by anything)
  • the buttons and keys of the movieinformation screen are inaccessible
  • does NOT return to the movieinformation screen. The custom window (1190) is still active (skin.ToggleDebug confirms this)
  • the Esc-key, Backspace-key, or right-click of mouse is required to return to the movieinformation screen and gain control over its buttons and keys


(2017-09-13, 00:04)jurialmunkey Wrote: In the custom window, in between the <window> and <controls> tag put a visibility condition.

e.g.
Code:
<window type="dialog" id="1190">
    <visible>Player.HasVideo</visible>
    <controls>
        <control type="videowindow" id="510">
...

EDIT: I just realised you might want to be able to specifically call the window. If so, use a window property as well

e.g.
Code:
<window type="dialog" id="1190">
    <visible>Player.HasVideo + !String.IsEmpty(Window(Home).Property(visible_1190))</visible>
    <onunload>ClearProperty(visible_1190,Home)</onunload>
    <controls>
        <control type="videowindow" id="510">
...

And when you want to call the window use:
Code:
<onclick>SetProperty(visible_1190,1,home)</onclick>

Already been there.
And by adding the visibility tag Kodi actually auto closes the dialog window after hitting the x-key to stop the video. Exactly what I expected and wanted.
But the downside is that there are unwanted side effects.
The unwanted side effects of this are described in this post : 2643396 (post)
Yesterday evening I found confirmation in the docs of what caused these unwanted side effects under the heading "2 Conditional Visibility for Dialogs" here : Conditional_visibility (wiki)
I reported my findings yesterday evening in this post in an update the the post with the unwanted side effects : 2646040 (post)

So hitting the x-key to stop video playback, or after the video has ended :
in fullscreen mode : closes the active window that was displaying the video.
in a windowed dialog with visibility tag : closes the active window that was displaying the video.
in a windowed dialog without visibility tag : does not close the active window that was displaying the video.
In all 3 cases, the active window that was displaying the video becomes completely transparant after hitting the x-key and the video is removed from the player
A nice bit of inconsistency, especially when considering that all input is still going to the completely transparant dialog window and ESC, Backspace, and right-click are the only ways out of this jail.
There is no way to close the dialog window from XML, because there is no way you can catch the video was stopped event and video has ended event. There are no OnPlayerStopped (e.g. x-key) and OnPlayerEnded (video played until the end) like in the Python API.

Like I also posted earlier :
(2017-09-12, 16:46)Luke Cage Wrote: Why ?

EDIT: Everything else works as expected just not the x-key on the windowed screen.

That's all I'm interested in.
Reply
#4
You didn't really comprehend what I wrote. I said that when you normally play a video, the reason why it closes and returns back when you press stop is because it is specifically designed to do that. A custom window is NOT specifically designed for playing video. Rather, custom windows have a lot of different uses. The custom window can't somehow magically read your mind and figure out how it should behave - it needs specific commands.

Regardless, your approach is not going to work for what you are trying to achieve: which I assume is playing the trailer over the top of the videoinfo window so that you return back to the info dialog when it is finished, yes? In the future, it would be helpful if you actually detail specifically what you are trying to achieve. Particularly considering I have already solved this issue in Horizon.

--------

Anyway, you need to put the videowindow INSIDE dialogvideoinfo and have it visible only when a hidden button is focused.


Code:
<control type="group">
    <visible>Player.HasVideo</visible>
    <visible>!String.IsEmpty(Window(Home).Property(TrailerPlaying))</visible>
    <control type="videowindow">
        <width>100%</width>
        <height>100%</height>
    </control>
</control>

And then have a hidden button in the same window like so (you need to replace SetFocus(5000) with the id of the menu you want to return to -- in grid I think it is 5000 so that's what I've put)
Code:
<control type="button" id="9503">
    <description>Trailer Play fake button</description>
    <label>208</label>
    <left>-2160</left>
    <width>1</width>
    <height>1</height>
    <font/>
    <onclick>SetFocus(5000)</onclick>
    <onleft>SetFocus(5000)</onleft>
    <onright>SetFocus(5000)</onright>
    <onup>SetFocus(5000)</onup>
    <ondown>SetFocus(5000)</ondown>
    <onback>SetFocus(5000)</onback>
    <oninfo>SetFocus(5000)</oninfo>
    <onclick condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying)) + Player.HasVideo">Stop</onclick>
    <onleft condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying)) + Player.HasVideo">Stop</onleft>
    <onright condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying)) + Player.HasVideo">Stop</onright>
    <onup condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying)) + Player.HasVideo">Stop</onup>
    <ondown condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying)) + Player.HasVideo">Stop</ondown>
    <onback condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying)) + Player.HasVideo">Stop</onback>
    <oninfo condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying)) + Player.HasVideo">Stop</oninfo>
    <onclick condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying))">ClearProperty(TrailerPlaying,Home)</onclick>
    <onleft condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying))">ClearProperty(TrailerPlaying,Home)</onleft>
    <onright condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying))">ClearProperty(TrailerPlaying,Home)</onright>
    <onup condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying))">ClearProperty(TrailerPlaying,Home)</onup>
    <ondown condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying))">ClearProperty(TrailerPlaying,Home)</ondown>
    <onback condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying))">ClearProperty(TrailerPlaying,Home)</onback>
    <oninfo condition="!String.IsEmpty(Window(Home).Property(TrailerPlaying))">ClearProperty(TrailerPlaying,Home)</oninfo>
    <visible allowhiddenfocus="true">false</visible>
</control>

And then in your trailer button, call the trailer like so:
Code:
<onclick>SetFocus(9503)</onclick>
<onclick>SetProperty(TrailerPlaying,1,Home)</onclick>
<onclick>PlayMedia($INFO[ListItem.Trailer],false,1)</onclick>


This method will open the trailer, and when you press any direction or click or press back, the trailer will stop and return you back to the menu. This is the only way I've been able to achieve what I think you are trying to achieve (though I can't be certain as you never said specifically what you are trying to do). The only problem with this method is that once the trailer stops, you need to press a direction to return focus to the menu.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#5
That is also already tried, videowindow control inside the DialogVideoWindow.xml : 2643477 (post)
It also has the unwanted side effect that the buttons of the movie information screen (DialogVideoInfo.xml) are still active during trailer playback. Which I already referred to in my previous post, by posting a link to my follow to that specific post.

I do not need markup. Like I already posted twice before :

(2017-09-13, 14:14)Luke Cage Wrote: ...
Like I also posted earlier :
(2017-09-12, 16:46)Luke Cage Wrote: Why ?

EDIT: Everything else works as expected just not the x-key on the windowed screen.

That's all I'm interested in.

I'm abandoning this thread because it is gone off-topic.
Reply
#6
If you actually try the method I have put up you will find that the buttons are not active because it passes focus to a hidden button. The only scenario I can see as being a problem is if you use a mouse. And I can think of a few tricks to deal with this but clearly you are pretty ungrateful for me taking the time out of my day to actually respond to you, so why should I bother.

Using a custom window will not work as there is no "onstop" type command. You would need to write an addon if you wanted to do this in a custom window.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply

Logout Mark Read Team Forum Stats Members Help
x-key (Stop playback) behaviour.0