Win [Solved] Is it possible to pause playback when exiting fullscreen?
#1
Hi. I'm looking for way to do something pretty simple, but have no idea how to.

I'm running XBMC with it's default skin Confluence, and have been trying to memorize the default keyboard shortcuts. When I press ESC while in full screen, it takes me back to the "Now Playing" menu where I had launched the video.

What I'd like XBMC to do is instead of continuing to play the video in the background, I'd like it to pause after hitting ESC to leave full-screen mode. Is this possible?

I'd note that I still want the videos visible as the "Now Playing" background, but also paused.

Reply
#2
Open your keymap.xml file under 'C:\Users\username\AppData\Roaming\XBMC\userdata\keymaps using notepad or any xml editor. find and replace <escape>PreviousMenu</escape> with <escape>Pause</escape>

If there is no keymafile then create one in notepad using

Code:
<keymap>
  <global>
    <keyboard>
          <escape>Pause</escape>
    </keyboard>
  </global>
</keymap>
Reply
#3
I appreciate you showing me how to change the keys. I didn't even think about changing the defaults.


But.. this isn't what I'm looking for. With that setting, all I've done is assign the pause function to the esc key (instead of using p or spacebar). What I'm looking for is the isn't to remap the ESC key entirely, but to automatically pause any playing videos when I do press it. I want ESC to still function as the "<escape>PreviousMenu</escape>".
Reply
#4
I think without editing the keymapfiles what you are looking for is not possible. You can put <escape>Pause</escape> under <FullscreenVideo>

Another option is to put the <escape>Pause</escape> just above the <escape>PreviousMenu</escape>. This will pause the movie and will return to the previous menu.
Reply
#5
You're looking for two tasks under one key, the only way you could do that is a custom batch file.
Reply
#6
You can use a Python script with the following contents:
Code:
import xbmc
xbmc.executebuiltin( "XBMC.Action(Pause)" )
xbmc.executebuiltin( "XBMC.Action(Fullscreen)" )

and then assign it to the Escape key:
Code:
<escape>XBMC.RunScript(/path/to/script-name.py)</escape>
Note: Use backslashes ( \ ) for script file path if running Windows
Reply
#7
Thanks for all the suggestions people, but nothing has worked so far.

These were the differing settings I used in keymap.xml.

Code:
<keymap>
  <FullScreenVideo>
    <keyboard>
          <escape>Pause</escape>
    </keyboard>
  </FullScreenVideo>
</keymap>
Pauses the video in fullscreen, and then resumes it. Does not allow exit to menu.

Code:
<keymap>
  <global>
    <keyboard>
          <escape>Pause</escape>
          <escape>PreviousMenu</escape>
    </keyboard>
  </global>
</keymap>
Functioned like default settings, with esc key going to previous menus. Did not pause video when exiting fullscreen.

Code:
<keymap>
  <global>
    <keyboard>
          <escape>PreviousMenu</escape>
          <escape>Pause</escape>
    </keyboard>
  </global>
</keymap>
Exits fullscreen on first press, and subsequent presses pause/resume video. Not possible to go back menus.

Code:
<keymap>
  <global>
    <keyboard>
<escape>XBMC.RunScript(C:\SOME_PATH\esc-fs-pause.py)</escape>
    </keyboard>
  </global>
</keymap>
Toggled between pausing, exiting to menu, and restarting video playback in fullscreen. Can't go back menus.

What I'm trying to do here isn't necessarily bind two functions to one key. I'm simply trying to pause video playback when I exit fullscreen mode via the ESC, or even Backspace, keys. I want the video playback to pause as I hit one of these buttons to bring up the last menu, but for them to still operate with their equivalent PreviousMenu/Back functions.

Is this something I could hopefully put in a request for, or can this be achieved in XBMC's current state? ie - Pausing video playback when exiting full-screen.
Reply
#8
... NM. It was right under my nose.

Thanks to the script offered to me by artrafael above, I created this file, and everything is working like I wanted. (I suppose I could have also added the mouse button for exiting to menu)

pause-fullscreen-exit.py
Code:
import xbmc
xbmc.executebuiltin( "XBMC.Action(Pause)" )
xbmc.executebuiltin( "XBMC.Action(Fullscreen)" )

I then created the keyboard.xml file, and placed this in it.

keyboard.xml
Code:
<keymap>
  <FullScreenVideo>
    <keyboard>
      <escape>XBMC.RunScript(C:\SOME_PATH\XBMC\userdata\pause-fullscreen-exit.py)</escape>
      <backspace>XBMC.RunScript(C:\SOME_PATH\XBMC\userdata\pause-fullscreen-exit.py)</backspace>
    </keyboard>
  </FullScreenVideo>
</keymap>

I guess I had simply missed calling the python script from the "FullScreenVideo" section. Thanks for all the help!
Reply

Logout Mark Read Team Forum Stats Members Help
[Solved] Is it possible to pause playback when exiting fullscreen?0