Keymap equivalent of JSON VideoPlayer.SeekPercentage
#1
Hey there...

I am trying to replicate Popcorn Hour's brilliant skimming controls with XBMC and
i figure it should be possible with the keymap.

For those who've never used a Popcorn Hour, when you play a video, pressing 1
will skip to the 10% point in that video, 2 will go to 20%, 3 is 30%, etc...

So by configuring my remote.xml's FullScreenVideo section to have something like :

Code:
<FullscreenVideo>
    <remote>
      <zero>Number0</zero>
      <one>SeekPercentage(10)</one>
      <two>SeekPercentage(20)</two>
      <three>SeekPercentage(30)</three>
      <four>SeekPercentage(40)</four>
      <five>SeekPercentage(50)</five>
      <six>SeekPercentage(60)</six>
      <seven>SeekPercentage(70)</seven>
      <eight>SeekPercentage(80)</eight>
      <nine>SeekPercentage(90)</nine>
      <left>StepBack</left>
      <right>StepForward</right>
      <up>BigStepForward</up>
      <down>BigStepBack</down>
      <back>SmallStepBack</back>
      <menu>OSD</menu>
      <start>OSD</start>
      <select>AspectRatio</select>
      <title>CodecInfo</title>
      <info>Info</info>
      <teletext>XBMC.ActivateWindow(Teletext)</teletext>
      <subtitle>ShowSubtitles</subtitle>
      <star>ShowSubtitles</star>
      <language>AudioNextLanguage</language>
      <hash>AudioNextLanguage</hash>
    </remote>
  </FullscreenVideo>

Is this something that will work? I am not home now so i can't try it...

Also, will the SeekPercentageRelative(10) work? If so, i guess it would be a way of fixing the BigStepForward/Back? It is currently documented that BigStepForward/Back will jump by 10% but actually it jumps by 10 minutes. StepForward/Back is documented as jumping 1% but it actually does 30 seconds...

-Pr.
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply
#2
So i tried changing the keymap but that didn't work...

My log gets a bunch of

Code:
ERROR: Keymapping error: no such action 'seekpercentage(10)' defined
ERROR: Keymapping error: no such action 'seekpercentage(20)' defined
ERROR: Keymapping error: no such action 'seekpercentage(30)' defined
ERROR: Keymapping error: no such action 'seekpercentage(40)' defined
ERROR: Keymapping error: no such action 'seekpercentage(50)' defined

Adding XMBC. in front of it also doesn't work.

It does work perfectly via the HTTP API... I know it's deprecated but i know nothing about how to JSON properly create a JSON url and use post instead of get in a browser...

So question now is :

Is there any way for me to send HTTP commands via the Keymap?

Any help would be truly appreciated...
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply
#3
From a quick look at http://xbmc.svn.sourceforge.net/viewvc/x...iew=markup I can't see any sign of a SeekPercentage function that you could use in a key mapping.

It seems a reasonable request, especially since it's supported by both JSON and the HTTP API. You could create a feature request ticket on trac.xbmc.org.

JR
Reply
#4
Well, it is reasonable but how could it be implemented when, currently, while playing video the numbered keys are destined to specific time seeking?

I mean, I can type (or press on a remote) 1150 and be taken to 00.11.50 in a movie.
For troubleshooting and bug reporting please make sure you read this first (usually it's enough to follow instructions in the second post).
Reply
#5
Mm, a good point.

You could easily override the <one>, <two> etc key mappings for FullScreenVideo to do a SeekPercentage, but then of course you couldn't use the keys to jump to a specific time.

JR
Reply
#6
I think it's an either/or situation. There could be a setting in advancedsettings.xml, defaulting to whatever you devs believe it's better/more intuitive, that would allow a user to switch methods.

Personally I prefer the "perfect time input" to the percentage (which I feel can be pretty much emulated with a proper combined use of long and short seeks, since it's anyway a ballpark figure what one's after in that case).
For troubleshooting and bug reporting please make sure you read this first (usually it's enough to follow instructions in the second post).
Reply
#7
Oh what the hell, it's an easy change. See http://trac.xbmc.org/ticket/11096

With these mods you can achieve what you want using the following keyboard.xml:

Code:
<keymap>
  <FullscreenVideo>
    <keyboard>
      <zero>PlayerControl(seekpercentage(0))</zero>
      <one>PlayerControl(seekpercentage(10))</one>
      <two>PlayerControl(seekpercentage(20))</two>
      <three>PlayerControl(seekpercentage(30))</three>
      <four>PlayerControl(seekpercentage(40))</four>
      <five>PlayerControl(seekpercentage(50))</five>
      <six>PlayerControl(seekpercentage(60))</six>
      <seven>PlayerControl(seekpercentage(70))</seven>
      <eight>PlayerControl(seekpercentage(80))</eight>
      <nine>PlayerControl(seekpercentage(90))</nine>
    </keyboard>
  </FullscreenVideo>
</keymap>

But of course you can no longer type a time to jump to it.

JR
Reply
#8
Ah, ok... so one just edits the keymap and there's no need for advancedsettings.

As all the unobtrusive options, I'm always in favour! Big Grin
For troubleshooting and bug reporting please make sure you read this first (usually it's enough to follow instructions in the second post).
Reply
#9
jhsrennie Wrote:Oh what the hell, it's an easy change. See http://trac.xbmc.org/ticket/11096

With these mods you can achieve what you want using the following keyboard.xml:

Code:
<keymap>
  <FullscreenVideo>
    <keyboard>
      <zero>PlayerControl(seekpercentage(0))</zero>
      <one>PlayerControl(seekpercentage(10))</one>
      <two>PlayerControl(seekpercentage(20))</two>
      <three>PlayerControl(seekpercentage(30))</three>
      <four>PlayerControl(seekpercentage(40))</four>
      <five>PlayerControl(seekpercentage(50))</five>
      <six>PlayerControl(seekpercentage(60))</six>
      <seven>PlayerControl(seekpercentage(70))</seven>
      <eight>PlayerControl(seekpercentage(80))</eight>
      <nine>PlayerControl(seekpercentage(90))</nine>
    </keyboard>
  </FullscreenVideo>
</keymap>

But of course you can no longer type a time to jump to it.

JR

Thank you so much!

This will make watching pr0n so much easier!! :p
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/376 TB HDD Space]
Reply
#10
Pr.Sinister Wrote:Thank you so much!

This will make watching pr0n so much easier!! :p

I've committed the change, so when the nightly builds resume you can install a nightly build to get the new functionality.

Is Pron the prequel to Tron? :-)

JR
Reply
#11
jhsrennie Wrote:I've committed the change, so when the nightly builds resume you can install a nightly build to get the new functionality.

If anyone wants to try it, I have a test build of XBMC.exe at:

http://swarchive.ratsauce.co.uk/XBMC/XBMC.zip

that includes the new seekpercentage code.

JR
Reply
#12
Hi,

Thanks, this works very well. This is exactly what I was looking for.

It was very difficult to find this information since it seems not to be documented (I found nothing about seekpercentage in the PlayerControl section in the builtin page)
Reply

Logout Mark Read Team Forum Stats Members Help
Keymap equivalent of JSON VideoPlayer.SeekPercentage0