Difference between revisions of "NeTV local UI"

From Chumby Wiki
Jump to: navigation, search
(add NeTVBrowser Nativekb command)
Line 15: Line 15:
 
  NeTVBrowser SetUrl http://www.yoururl.com
 
  NeTVBrowser SetUrl http://www.yoururl.com
  
The correct way to keep a page on screen is to use the browser's multi-tab feature
+
The recommended way to keep a page on screen without losing the Control Panel is to use the browser's multi-tab feature
 
  NeTVBrowser Tab 1 http://www.yoururl.com
 
  NeTVBrowser Tab 1 http://www.yoururl.com
 
  NeTVBrowser Tab 1 Hide
 
  NeTVBrowser Tab 1 Hide
 
Where '1' is the index of the tab. Maximum 10 tabs are supported (index 9). <br/>
 
Where '1' is the index of the tab. Maximum 10 tabs are supported (index 9). <br/>
 
Tab 0 is reserved for NeTV UI.<br/>
 
Tab 0 is reserved for NeTV UI.<br/>
A keep-alive timer is responsible to keep it pointing to http://localhost at 1 minute interval.
+
A keep-alive timer is responsible to keep it pointing to http://localhost at 1 minute interval. <br/>
 +
 
 +
To turn off the keep-alive timer
 +
NeTVBrowser KeepAlive off
  
 
<br/>To call or inject JavaScript function from SSH console (remember to escape special characters):
 
<br/>To call or inject JavaScript function from SSH console (remember to escape special characters):
Line 48: Line 51:
 
Some commonly used key names are: cpanel,widget,up,down,left,right,enter,center,esc,del,backspace,space & alphanumeric keys
 
Some commonly used key names are: cpanel,widget,up,down,left,right,enter,center,esc,del,backspace,space & alphanumeric keys
  
 +
<br/>Buttons on infra-red are treated as native keyboard keys in NeTV's Linux kernel (/dev/input/event1). However, by default NeTVBrowser overrides key press events in order to handle key counting, key sequence/combo, page scrolling & delivered directly to HTML Control panel as a JavaScript function call.
 +
<br/>Example: Hold the control panel button on IR remote for more than 3 seconds & release it will reload/reset the Control Panel. <br/>
 +
In order to have the IR buttons events delivered directly to JavaScript as normal keyboard events, use:
 +
NeTVBrowser Nativekb On
 +
The JavaScript in the loaded HTML page will have to handle scrolling & counting of key presses manually.
 +
The above mentioned reset functionality will be lost.
 +
<br/>
 +
<br/>
  
 
More interesting stuffs to come...
 
More interesting stuffs to come...

Revision as of 02:15, 20 October 2011

NeTV local UI is entirely rendered by Webkit browser, running in a chromeless/fullscreen fashion. The UI is written in JavaScript & HTML. Hardware integration is supported by submitting POST/GET request to http://localhost/bridge. See NeTV_web_services.

The starting point for playing with the UI is to edit files found in /usr/share/netserver/docroot This is translated to http://localhost

The overlay effect is done using chroma key compositing.
Any color that is (240,0,240 or #F000F0) will take on the color of the background video stream.

The browser executable is located at /usr/bin/NeTVBrowser To start/stop/restart the browser, use a helper script

/etc/init.d/chumby-netvbrowser start/stop/restart


To point the browser at a different URL
Note that, however, a keep-alive timer will kick in within 1 minute and switch it back to http://localhost/

NeTVBrowser SetUrl http://www.yoururl.com

The recommended way to keep a page on screen without losing the Control Panel is to use the browser's multi-tab feature

NeTVBrowser Tab 1 http://www.yoururl.com
NeTVBrowser Tab 1 Hide

Where '1' is the index of the tab. Maximum 10 tabs are supported (index 9).
Tab 0 is reserved for NeTV UI.
A keep-alive timer is responsible to keep it pointing to http://localhost at 1 minute interval.

To turn off the keep-alive timer

NeTVBrowser KeepAlive off


To call or inject JavaScript function from SSH console (remember to escape special characters):

NeTVBrowser JavaScript "console.log('hello console');"
NeTVBrowser JavaScript "my_function();  function my_function() { console.log('hello console'); }"


Night mode (Tab 0 only)

NeTVBrowser InvertColor on
NeTVBrowser InvertColor off


Make the browser fullscreen / NOT fullscreen

NeTVBrowser Fullscreen
NeTVBrowser SetBox 100 100 400 300    //xx yy width height


Screen rotation

NeTVBrowser Rotate 0/90/180/270


Show debug traces & JavaScript console output

mount -o remount,rw /
vi /etc/init.d/chumby-netvbrowser

Replace NeTVBrowser > /dev/null 2>&1 & with NeTVBrowser &

mount -o remount,ro /


Simulate a keyboard event

NeTVBrowser Key valid_key_name

Some commonly used key names are: cpanel,widget,up,down,left,right,enter,center,esc,del,backspace,space & alphanumeric keys


Buttons on infra-red are treated as native keyboard keys in NeTV's Linux kernel (/dev/input/event1). However, by default NeTVBrowser overrides key press events in order to handle key counting, key sequence/combo, page scrolling & delivered directly to HTML Control panel as a JavaScript function call.
Example: Hold the control panel button on IR remote for more than 3 seconds & release it will reload/reset the Control Panel.
In order to have the IR buttons events delivered directly to JavaScript as normal keyboard events, use:

NeTVBrowser Nativekb On

The JavaScript in the loaded HTML page will have to handle scrolling & counting of key presses manually. The above mentioned reset functionality will be lost.

More interesting stuffs to come...