0

Using blockedKeys on videoplayer

I am trying to block some player keys. I have added a listener for 'onBlockedKeyPress' and I am doing the following :

CODE
_onBlockedKeyPress: function(event) {
event.preventDefault();
event.stopPropagation();
},


if I press "pause" (one of my blocked keys), I can see, in the logs, the line saying a blocked key is called. I also logged my listener and it is properly executed.

However, the video is paused (instead of the pause being ignored).

What is the proper way to block keys ?

Regards
Jean-Noel

by
11 Replies
  • QUOTE (jngadreau @ Jun 10 2009, 06:27 AM) <{POST_SNAPBACK}>
    I am trying to block some player keys. I have added a listener for 'onBlockedKeyPress' and I am doing the following :

    CODE
    _onBlockedKeyPress: function(event) {
    event.preventDefault();
    event.stopPropagation();
    },


    If you want to keep the key blocked, then don't call preventDefault(). The default action on a blocked key is to "block" it. By stopping the action you are allowing the key to proceed through without being blocked. Hope that makes sense.

    -Jeremy
    0
  • ;-) I guess I had it all wrong ;-)
    Thanks a lot

    Jean-Noel
    0
  • Ok. I must be missing something. I kept no code in my handler => pause still stops the video. I kept only the stopPropagation => same thing.

    The "pause key pressed" is not showed anymore but the video is still stopped. Looking in the logs, something else must be catching the event :

    QUOTE
    sending key =4143
    (13:22:31.074) IPI: Widget Channel - Key Pause
    EM 00:01:06:282: [T:2380] Widget Channel - Key Pause
    (13:22:31.074) IPI: Youngstown - (XPSM) command - Pause
    (13:22:31.076) IPI: Widget Channel - XPSM Paused
    TV 00:01:06:284: [T:2364] tv.playback-control.state-changed POINTER(0x9d11538) POINTER(0x9d11538)
    WM 00:01:06:286: [T:2364] State Change from 0 to 1
    WM 00:01:06:290: [T:2364] ******** Utils.Doggy.poke()
    WM 00:01:06:291: [T:2364] ** main._updateScreensaver() @do poke true @doggy 1 alive true @doggy 1 asleep false @doggy 2 alive true @doggy 2 asleep false
    WM 00:01:06:292: [T:2364] ******** Utils.Doggy.poke()
    WM 00:01:06:292: [T:2364] ******** Utils.Doggy.poke()
    WM 00:01:06:298: [T:2364] blocked key pressed


    I even tried to define a onPlayControlKeyPress handler but it did not do much (called after the "blocked key pressed").

    Thanks in advance for your help
    Jean-Noel

    Note: WDK: 0.9.6-18
    0
  • Are you running this on the WDK? That log output makes me think you are running on another platform (Intel specifically).

    -Jeremy
    0
  • I am running it of a Intel STB. What are the player keys equivalent in the simulator ?

    JN
    0
  • QUOTE (jngadreau @ Jun 12 2009, 12:06 PM) <{POST_SNAPBACK}>
    I am running it of a Intel STB. What are the player keys equivalent in the simulator ?

    JN


    Unfortunately the blockedKeys functionality hasn't been certified yet on the Intel platform, so I can't insure it's working 100% yet. To test in the WDK to see if that's the issue, the command to type in via the console is:

    /key play

    for play and:

    /key pause

    for pause (stop follows a similar pattern).

    Make sure you have switched to your widget context before issuing those commands.

    -Jeremy
    0
  • Thanks again Jeremy. ok for the Intel side of things.

    For the "/key ...", I am going to test that ASAP. This is going to be great. I assume the keys available are :

    play
    pause
    stop
    rewind
    fastforward
    skipnext ?
    skipprevious ?

    This is going to make testing the player a lot easier :-)

    Regards
    Jean-Noel
    0
  • I think only play, pause, stop are available. I will double check.
    0
  • Thanks :-)
    0
  • The /key command may be case sensitive. Here are some key names you can send:

    Play
    Pause
    Stop
    Rewind
    Forward (or FastFwd, should be the same underlying key)

    also standards like:

    Up
    Down
    Left
    Right
    Select (or Enter)
    Home

    and

    Red
    Blue
    Green
    Yellow
    0
  • Thanks for the answer :-). I tried it in the console (for instance "/key Pause") but the video keeps playing. Am I missing something ?
    0

Recent Posts

in General - Yahoo! TV Widgets