Login

Sign Up

  • Account Information
  • Company Information
  • Contact














* Whale Eco Distribution Agreement

Leave empty when commercial agreements with individual device manufactures are required. Individual agreements overrule the default scope for app distribution.

Already have an account ?Click here to login

Forget Password

Remote Control

Remote control:



Usually the remote control is remotely controlled, allowing standard 5-way control with additional physical keys as a shortcut to common operations. The buttons available for the application are as follows:

ButtonApp Usage
OKSelect/Enter
Up ArrowMoves focus to up
Right ArrowMoves focus to the right
Down ArrowMoves focus to down
Left ArrowMoves focus to the left
BackReturns to the previous panel, or returns to the Home screen if there is no previous page.
Number ButtonsInput number

Color Buttons: 

Red, Green, Yellow, Blue

Customizable by the app
Video control buttons: play, pause, stop, fast forward, rewindControl video playback


Remote keys


Note: Different devices across different years and brands can define different key code values for their remote control keys.

You must use VK_ and KEYCODE_ constants instead of checking for specific key code values. Key constants are provided to give generic remote control support. 

Remote control keys are supported as shown in below table:

Button
Keycode HTML5Keycode Android
Enter

VK_ENTER

KEYCODE_ENTER

LeftVK_LEFTKEYCODE_DPAD_LEFT
DownVK_DOWNKEYCODE_DPAD_DOWN
RightVK_RIGHTKEYCODE_DPAD_RIGHT
UPVK_UPKEYCODE_DPAD_UP
0-9VK_0 to VK_9KEYCODE_1 to KEYCODE_9
BackVK_BACKKEYCODE_BACK
RedVK_REDKEYCODE_PROG_RED
BlueVK_BLUEKEYCODE_PROG_BLUE
GreenVK_GREENKEYCODE_PROG_GREEN
YellowVK_YELLOWKEYCODE_PROG_YELLOW
PlayVK_PLAYKEYCODE_MEDIA_PLAY
PauseVK_PAUSEKEYCODE_MEDIA_PAUSE
Play/PauseVK_PLAY_PAUSEKEYCODE_MEDIA_PLAY_PAUSE
StopVK_STOPKEYCODE_MEDIA_STOP
Fast fwdVK_FAST_FWDKEYCODE_MEDIA_FAST_FORWARD
RewindVK_REWINDKEYCODE_MEDIA_REWIND
Channel UP/DOWNVK_PAGE_UP/VK_PAGE_DOWNKEYCODE_CHANNEL_UP/KEYCODE_CHANNEL_DOWN

                              2、遥控器.png















Adding Event Listener



The keydown event is fired when users press a key on the Remote Control, Remote Control Keyboard or external USB Keyboard. To handle the keydown event, you need to add the event listener to the document element.

document.addEventListener('keydown',function (e) {
/* Handling keydown event */

/*e.preventDefault();//Add prevent Default when you handle for back key*/
}, true);


Handling Key Event



To handle the received keycode from the keydown event, add the below code in your application. Example of implementation can be found here

HTML5Android (APK)
function KeydownEvent(e) {    
    switch (e.keyCode) {        
        case VK_PLAY:            
        //Your Code here            
        break;        
        case VK_STOP:            
        //Your Code here            
        break;        
        case VK_PAUSE:            
        //Your Code here            
        break;
        case VK_PLAY_PAUSE:            
        //Your Code here            
        break;        
        case VK_BACK:
        case VK_BACK_SPACE: 
        /* Add preventDefault
         only if focus is not 
         on input field */
        e.preventdefault();           
        //Your Code here            
        break;        
        case VK_FAST_FWD:            
        //Your Code here
        break;
        case VK_REWIND:            
        //Your Code here
        break;
        
        case VK_LEFT:            
        //Your Code here            
        break;        
        case VK_RIGHT:            
        //Your Code here            
        break;    
      }
  }
function KeydownEvent(e) {    
    switch (e.keyCode) {        
        case KEYCODE_MEDIA_PLAY:            
        //Your Code here            
        break;        
        case KEYCODE_MEDIA_STOP:            
        //Your Code here            
        break;        
        case KEYCODE_MEDIA_PAUSE:            
        //Your Code here            
        break;
        case KEYCODE_MEDIA_PLAY_PAUSE:            
        //Your Code here            
        break;        
        case KEYCODE_BACK:
        /* Add preventDefault
         only if focus is not 
         on input field */ 
        e.preventdefault();           
        //Your Code here            
        break;
        case KEYCODE_MEDIA_FAST_FORWARD:            
        //Your Code here
        break; 
        case KEYCODE_MEDIA_REWIND:            
        //Your Code here   
        break;
           
        case KEYCODE_DPAD_LEFT:            
        //Your Code here            
        break;        
        case KEYCODE_DPAD_RIGHT:            
        //Your Code here            
        break;    
      }
  }


You do have to take into account special handling for fast forward and rewind handling. Devices running our Smart TV OS can be sold with full feature supported remote controls, but also with simple remote controls. It's a must to support fast forward and rewind remote control keys on top of left and right keys if you handle trickmodes with it.


2、遥控器.png           image.png


In addition, the Whale OS is also compatible with almost all key codes of a standard keyboard. You can also be compatible with more devices.

The following example shows the key code received from the keydowm event. You can view it in your browser:https://support.nettvservices.com/samples/keydown.html 


function init() {    
    document.addEventListener('keydown',handlekeydown, false);
  };
function handlekeydown(e) {    
    document.getElementById("test").innerHTML = e.keyCode;
  };


Interested in becoming an Zeasn partner?
We’d love to hear from you.
Copyright © 2011 -2023 Beijing Zeasn Information Tech CO., Ltd. All Rights Reserved