sonny.windstrup@kiss-technology.com with the subject “KML DOCUMENT SUBSCRIBE”.
Slotsmarken 10
DK-2970 Hørsholm
Denmark
KML was initially developed by KiSS Technology as a simple and efficient platform for interactive online applications on low-cost embedded devices and set-top boxes (STBs). We had already built a network enabled DVD player, the KiSS DP-500 (which was the World’s first and so far (Sept 2003) the World’s only DivXTM certified DVD player!) – The device was initially capable of using its network connection for retrieval and playback of local media content (MPEG4, MP3, JPEGs, etc) shared from a PC on the same network; a hugely popular feature.
If such an STB web browser could be succesfully implemented, it would have many useful advantages in areas of portability, code maturity, javascript support and general availability of pre-existing content and online applications. However, the web-browser approach was abandoned when we determined that conventional web technology simply don’t work very well for STB use. Limited guaranteed TV screen resolution must be considered, as well as numerous other annoyance factors and concerns compromising the would-be usefulness of the solution:
Notice, loading a KML “page” does not imply that the client clears the graphics display. Instead, the host has to tell the client specifically to draw a solid filled rectangle spanning the screen with the desired color of transparency in order to clear the screen. This is intentional and serves to allow a response from a host application to only update a portion of the screen.
KML is implemented as well-formed XML documents with a number of levels of nodes and subnodes describing the client commands. There are currently still no officially endorsed DTDs or schemas provided by KiSS to validate KML documents. Such will be made available when language specifications stabilize.
Sample valid KML page:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<KMLPAGE
version=”2.0”>
(...page content...)
</KMLPAGE>
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<KMLPAGE version="2.0">
<BACKGROUND vgradient="0,0,0-0,0,128" />
<FILLRECT coords="0,0,719,479" pen="0" />
<TEXT coords="60,60" font="0" pen="255"> Hello, world </TEXT>
</KMLPAGE>
The above very simple example renders a blue screen fading to black, with a plain white text in the top left hand corner stating ‘Hello World’ (Fig. 1).
The BACKGROUND item overwrites the background layer [YUV buffer] with the black-blue gradient.
The FILLRECT item overwrites the 8-bit foreground layer [OSD buffer] with pen 0 (transparent).
The TEXT item prints the text with font 0 (default) and pen 255 (white).
These items are all attached to the KMLPAGE node. This means, they’re executed as the page is parsed.
There are no events of any kind on this page, which makes it a dead end. You can basically only press STOP, which shuts down the KML client and reverts the device to normal operation.
Usually, KML documents have at least some actions and events associated with remote button presses so that interactive operation is possible. We recommend that pages on logical dead-end paths should be equipped with at least some kind of means for returning the user to the previous page they came from.
Fig. 2 shows logical KML document structure.

Usage:
<GOTO href="destination" />
Node Parameters:
href Location of KML document to be loaded [opened].
<GOTO href="http://www.host.com/kml/page2.xml" />
<FILLRECT coords=”x,y,w,h” pen=”color” />
Node Parameters:
coords Placement and size of filled rectangle.
pen Color or palette index.
Parameter data for “coords” :
x Pixel X coordinate of top-left corner
y Pixel Y coordinates of top-left corner
w Pixel Width of rectangle
h Pixel Height of rectangle
Example:
<FILLRECT coords="100,100,400,100" pen="255" />
<FILLRECT coords="150,150,200,200" pen="16" />
<FILLRECT coords=”x,y,w,h” pen=”color” />
Parameters:
coords Placement and size of rectangle.
pen Color or palette index.
Parameter data for “coords” :
x Pixel X coordinate of top-left corner
y Pixel Y coordinates of top-left corner
w Pixel Width of rectangle
h Pixel Height of rectangle
Example:
<RECT coords="100,100,400,100" pen="255" />
<RECT coords="150,150,200,200" pen="16" />
<FIP [speed='a'] [intensity='b']> (text) </FIP>
<FIP speed='2' intensity='6'>SCROLLING MESSAGE</FIP>
<TEXT coords='x,y' [font='(0-3)’] [pen='color']>
(..actual message text...)
</TEXT>
<TEXT coords='101,180' font='1' pen='0'>
Large text
</TEXT>
<TEXT coords='101,250' font='0' pen='31'>
Small text
</TEXT>
Image buffers are not cleared automatically : use CLEARIMAGE command.
Loading an image to an existing buffer (re-using id) does not overwrite that buffer. You have to clear it first.
<LOADIMAGE id="name" href="source" />
<LOADIMAGE id="logo" href="http://host/graphics/logo.gif" />
<IMAGE coords='x,y' src='name' />
<IMAGE coords='74,84' src='logo' />
<MENUSELECT item='<id>' />
<MENUSELECT item='one' />
<PLAYMEDIA href=”source” />
<PLAYMEDIA href="http://www.host.com/media/test.mp3" />
http://www.w3.org/TR/REC-xml#sec-cdata-sect
Most action blocks are tied to specific events and may only be attached to the main KMLPAGE node. Some action blocks are nested with their parent objects such as BUTTON and MENUITEM event types. Menuitems are further described later.
<ONUNLOAD><![CDATA[
(...commands to be executed...)
]]></ONUNLOAD>
<ONUNLOAD><![CDATA[
<FILLRECT coords=”0,0,719,479” pen=”0” />
]]></ONUNLOAD>
<ONINTERVAL interval='50'><![CDATA[
<FILLRECT coords='0,0,719,479' pen='249' />
]]></ONUNLOAD>
<ONTIMER timeout='10000'><![CDATA[
<FILLRECT coords='0,0,719,479' pen='216' />
]]></ONTIMER>
<ONMETADATA><![CDATA[
(...commands to be executed...)
]]></ONMETADATA>
<PLAYMEDIA href="http://172.15.4.24/mp3/domino.pls" />
<ONMETADATA><![CDATA[
<TEXT coords="100,100" font="0" pen="255"> $$MP3_Title$$ </TEXT>
]]></ONMETADATA>
The above example updates
<ONMEDIASTOPPED><![CDATA[
(...commands to be executed...)
]]></ONMEDIASTOPPED>
<PLAYMEDIA href="http://host/mp3/domino.pls" />
<ONMEDIASTOPPED><![CDATA[
<TEXT coords="100,100" font="0" pen="255">
Media playback has ceased.
</TEXT>
]]></ONMEDIASTOPPED>
Usage:
Button Code Name |
Button |
Scancode (Decimal) |
Scancode (Hex) |
|
SHOW_ONE_KEYDOWN |
1 |
74 |
0x004A |
|
SHOW_TWO_KEYDOWN |
2 |
75 |
0x004B |
|
SHOW_THREE_KEYDOWN |
3 |
76 |
0x004C |
|
SHOW_FOUR_KEYDOWN |
4 |
77 |
0x004D |
|
SHOW_FIVE_KEYDOWN |
5 |
79 |
0x004F |
|
SHOW_SIX_KEYDOWN |
6 |
80 |
0x0050 |
|
SHOW_SEVEN_KEYDOWN |
7 |
81 |
0x0051 |
|
SHOW_EIGHT_KEYDOWN |
8 |
82 |
0x0052 |
|
SHOW_NINE_KEYDOWN |
9 |
83 |
0x0053 |
|
SHOW_ZERO_KEYDOWN |
0 |
73 or 78 |
0x0049 |
|
SHOW_TITLE_KEYDOWN |
Title Menu |
84 |
0x0054 |
|
SHOW_MENU_KEYDOWN |
Root Menu |
65 |
0x0041 |
|
SHOW_RETURN_KEYDOWN |
Return |
93 |
0x005D |
|
SHOW_UP_KEYDOWN |
Up |
67 |
0x0043 |
|
SHOW_DOWN_KEYDOWN |
Down |
68 |
0x0044 |
|
SHOW_LEFT_KEYDOWN |
Left |
69 |
0x0045 |
|
SHOW_RIGHT_KEYDOWN |
Right |
70 |
0x0046 |
|
SHOW_ENTER_KEYDOWN |
Enter |
71 or 115 |
0x0047 |
|
SHOW_REV_KEYDOWN |
Fast Reverse |
94 |
0x005E |
|
SHOW_PLAY_KEYDOWN |
Play/Pause |
16387 |
0x4003 |
|
SHOW_FWD_KEYDOWN |
Fast Forward |
95 |
0x005F |
|
SHOW_PREV_KEYDOWN |
Previous |
3 or 16389 |
0x4005 |
|
SHOW_NEXT_KEYDOWN |
Next |
2 or 16388 |
0x4004 |
|
SHOW_STEP_KEYDOWN |
Single Step |
96 |
0x0060 |
|
SHOW_AUDIO_KEYDOWN |
Audio |
97 |
0x0061 |
|
SHOW_SUBTITLE_KEYDOWN |
Subtitle |
98 |
0x0062 |
|
SHOW_ANGLE_KEYDOWN |
Angle |
100 |
0x0064 |
|
SHOW_ZOOM_KEYDOWN |
Zoom |
99 |
0x0063 |
|
SHOW_REPEAT_KEYDOWN |
Repeat |
101 |
0x0065 |
|
SHOW_BOOKMARK_KEYDOWN |
Bookmark |
102 |
0x0066 |
|
SHOW_SETUP_KEYDOWN |
Setup |
768 |
0x0300 |
|
SHOW_CLEAR_KEYDOWN |
Clear |
103 |
0x0067 |
|
SHOW_SEARCH_KEYDOWN |
Search |
104 |
0x0068 |
Enclosed in this archive, the file etc/osdpalette.png shows the color palette in a handy, printable reference chart.