Pressing Play While Content is Playing
#1
Is there a way to take an action when a user hits the Play button (or "P" on the keyboard) while something is currently playing?

Ultimately I like to show the user a set of information (time remaining, title, poster, etc) if they hit the play button while a video is currently playing.

I know I can use the Info button on the remote (or "I" on the keyboard) to get a bunch of this information but the way most remotes are set up, it is way easier to find the play button than to figure out where the Info button is.

Thanks
Reply
#2
Not sure if you can override the play action button in the keymap. Might cause issues for people with a play/pause button on their remote.

Either way, what you could do instead is have this information display when the video is paused. You can put the controls you wish to display in dialogseekbar with a visibility condition like this:

xml:

<visible>VideoPlayer.HasFullscreen + Player.Paused + !Window.IsVisible(videoosd) + !Window.IsVisible(fullscreeninfo)</visible>

And it will show whenever you pause without hitting info. Alternatively if you want it during playback, you could add it to the videoosd so it displays whenever you press ok or whatever button you use to bring up the videoplayer controls.
Reply
#3
I think I have this kind of where I want it by using a keymap but I'm having a slight issue. Here is my keymap:
xml:
<keymap>
  <fullscreenvideo>
    <keyboard>
      <p mod="longpress">Info</p>
    </keyboard>
  </fullscreenvideo>
  <fullscreeninfo>
    <keyboard>
      <p>Back</p>
    </keyboard>
  </fullscreeninfo>
</keymap>

This works great as I am able to display Info on a longpress of the P key. I'm doing it with the longpress mod as I don't want to disrupt the default action of Play on a short press (ex. unpausing, breaking out of FF or Rewind).

The problem is that I have to also do a longpress of the P key to get the Back action to take place on fullscreeninfo and would prefer that to be a shortpress. I tried mod="shortpress" but that doesn't do anything.

Is there a way to get the Back action to happen on a short press of the P key when I have a longpress mod elsewhere in my keymap?
Reply
#4
i dont think fullscreeninfo exists is why that doesnt work
Reply
#5
It exists (https://kodi.wiki/view/Keymap#Windows) and it works.

It just seems that if I have a mod="longpress" on the P key for when the window is "fullscreenvideo", it is also doing the longpress for the Back action on "fullscreeninfo" (which I want that to be shortpress).
Reply
#6
my mistake
Reply
#7
(2023-02-21, 20:53)Doctor Eggs Wrote: It exists (https://kodi.wiki/view/Keymap#Windows) and it works.

It just seems that if I have a mod="longpress" on the P key for when the window is "fullscreenvideo", it is also doing the longpress for the Back action on "fullscreeninfo" (which I want that to be shortpress).

Are you sure you're not just doing Info again from the fullscreenvideo keymap? The infodialogs have a hardcoded behaviour where Info is remapped to Close, so it could just be that longpress from the fullscreenvideo closing it again.

Try <p>Info</p> instead.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#8
Thanks for the help with this.

So it turns out this does work. Tested it in Estuary and it works as expected:
xml:
<keymap>
  <fullscreeninfo>
    <keyboard>
      <p>Info</p>
    </keyboard>
  </fullscreeninfo>
  <fullscreenvideo>
    <keyboard>
      <p mod="longpress">Info</p>
    </keyboard>
  </fullscreenvideo>
</keymap>

But for whatever reason, the skin I am working on isn't using fullScreenInfo. I'm assuming the issue I'm having is that my skin doesn't have the fullScreenInfo, so it is just using the value in the fullScreenVideo instead.

I'm thinking that I may have used a bad base skin for my starting point for my new skin...
Reply
#9
DialogFullScreenInfo.xml isn't required for a skin to work. If you don't have it then I'm fairly sure Kodi sets Player.ShowInfo to true instead.

If you do have the dialog xml, check capitalisation on filename. I remember always having issues with that particular dialog due to case sensitivity. Check that it matches how it is capitalised in Estuary.

You can just add it as a blank xml (with the usual xml header and window tags but leave controls blank). That way you get the control over the keymap but don't need to worry about skinning it. Just use a visibility condition in seekbar that checks for it using window.isvisible()
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#10
late note, you can see window names directly from kodi if you enable debugging in the skin's addon.xml

xml:
<extension point="xbmc.gui.skin" debugging="true">

itll show up in the upper left corner exactly which is open

then you know which to apply for in the keymap without guessing its name has been set to what is in the wiki
Reply
#11
(2023-02-23, 03:02)jurialmunkey Wrote: DialogFullScreenInfo.xml isn't required for a skin to work. If you don't have it then I'm fairly sure Kodi sets Player.ShowInfo to true instead.

If you do have the dialog xml, check capitalisation on filename. I remember always having issues with that particular dialog due to case sensitivity. Check that it matches how it is capitalised in Estuary.

You can just add it as a blank xml (with the usual xml header and window tags but leave controls blank). That way you get the control over the keymap but don't need to worry about skinning it. Just use a visibility condition in seekbar that checks for it using window.isvisible()

Thanks for this. That was exactly what I needed. I unfortunately had all of my code for DialogFullScreenInfo.xml in the VideoFullScreen.xml and then changing visibility for it to show the info screen. I'll need to rework some things but I'm heading in the right direction.
(2023-03-01, 07:39)jepsizofye Wrote: late note, you can see window names directly from kodi if you enable debugging in the skin's addon.xml

xml:
<extension point="xbmc.gui.skin" debugging="true">

itll show up in the upper left corner exactly which is open

then you know which to apply for in the keymap without guessing its name has been set to what is in the wiki

 This is awesome and really helpful. I had no idea that existed. Thanks so much!
Reply

Logout Mark Read Team Forum Stats Members Help
Pressing Play While Content is Playing0