Difference between revisions of "NeTV local UI"

From Chumby Wiki
Jump to: navigation, search
Line 12: Line 12:
 
  /etc/init.d/chumby-netvbrowser start/stop/restart
 
  /etc/init.d/chumby-netvbrowser start/stop/restart
  
<br/><br/>To point the browser at a different URL<br/>Note that, however, a keep-alive timer will kick in within 1 minute and switch it back to http://localhost/
+
<br/>To point the browser at a different URL<br/>Note that, however, a keep-alive timer will kick in within 1 minute and switch it back to http://localhost/
  NeTVBrowser -qws 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 correct way to keep a page on screen is to use the browser's multi-tab feature
  NeTVBrowser -qws Tab 1 http://www.yoururl.com
+
  NeTVBrowser Tab 1 http://www.yoururl.com
  NeTVBrowser -qws 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/><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):
  NeTVBrowser -qws JavaScript "console.log('hello console');"
+
  NeTVBrowser JavaScript "console.log('hello console');"
  NeTVBrowser -qws JavaScript "my_function();  function my_function() { console.log('hello console'); }"
+
  NeTVBrowser JavaScript "my_function();  function my_function() { console.log('hello console'); }"
  
<br/><br/>Night mode (Tab 0 only)
+
<br/>Night mode (Tab 0 only)
  NeTVBrowser -qws InvertColor on
+
  NeTVBrowser InvertColor on
  NeTVBrowser -qws InvertColor off
+
  NeTVBrowser InvertColor off
  
<br/><br/>Make the browser fullscreen / NOT fullscreen
+
<br/>Make the browser fullscreen / NOT fullscreen
  NeTVBrowser -qws Fullscreen
+
  NeTVBrowser Fullscreen
  //NeTVBrowser -qws SetBox xx yy width height
+
  NeTVBrowser SetBox 100 100 400 300    //xx yy width height
NeTVBrowser -qws SetBox 100 100 400 300
+
  
 +
<br/>Screen rotation
 +
NeTVBrowser Rotate 0/90/180/270
 +
 +
<br/>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 /
 +
 +
<br/>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
  
  
 
More interesting stuffs to come...
 
More interesting stuffs to come...

Revision as of 04:12, 27 September 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 correct way to keep a page on screen 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 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


More interesting stuffs to come...