Xtreamer RSS Guide
From Xtreamer
Introduction
Since firmware version 2.2 of Xtreamer we have had the ability to easily host a file on any drive attached to the Xtreamer (Internal or USB) by simply creating a folder on the sda1 drive called scripts and placing a file inside this folder called menu.rss which can be created manually using any text editor. You can also use any menu.rss created by others for the Xtreamer or other similar Realtek devices (Such as the lists posted on the official forum) and this will work also. The format of the menu.rss files are detailed below.
Standard RSS Structure
<?xml version='1.0' ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title>RSS Menu Title</title> <item> feeds go here</item> </channel> </rss>
Please note that all of the tags / elements used (except the xml versioning) have a start <nameofelement> and an end </nameofelement> these tags are case specific. Elements can also have optional additional attributes for example you could have: <exampleelement>Xtreamer Rocks!</exampleelement> and then add optional entries like this: <exampletag height:"120px" width:"100px">Xtreamer Rocks!</exampletag>. There are many other similar types of usage which will be detailed below. If you have any further questions after reading the guide then please post them on the official Xtreamer forum. Remember that you can view any of the current rss feeds in any text editor or view the source of any online RSS feed such as those hosted by Xtreamer at [1] to see how they are compiled. Remember that you can copy and paste an existing feed and change just the title / link & thumbnail to your own. If you get a 404 Error on trying to enter the 'Custom RSS (Personal)' page then you have made a typing error or installed the menu.rss incorrectly. Paste details of your file names and locations and your rss file to the official forum for help in finding the typing mistake or assistance in making it work.
<item> Element Structure
Every internet RSS feed has its own <item> section. Some are simply links to further rss feed submenus. Each feed MUST consist of the following as a minimum:
<item> <title>Name of feed here</title> <link>URL of feed for example http://www.myfeed.com/rss</link> >>All optional elements & attributes go here<< </item>
Optional 'item' Element Attributes
Thumbnails - <media:thumbnail
It is useful to provide a link to a logo for the feed to aid quick visual recognition of your favourites. If you wish to use this feature you simply need a link to a logo. Note: The image should ideally be square but doesn't have to be and preferably 300x300 but can be any size. Be aware that larger images may take longer to load and as such should be avoided unless essential. To add a thumbnail to your feed simply use the following line: <media:thumbnail url="http://www.example.com/image.jpg"/> You can also define the size using optional attributes: <media:thumbnail url="http://www.example.com/image.jpg" width="120" height="90" />
'mediaDisplay' Element Attributes
Styles - <mediaDisplay name
There are several formats which can be used to alter the way in which RSS feeds will present themselves on screen. These styles are used as templates which can then be further configured to tweak the layout to your preference. The following styles are available with those currently in use by Xtreamer and detailed here highlighted with *. Please be aware that these styles are CASE SPECIFIC and should be carefully typed.
photoView - Large 'logo panel' type display photoFocusView - Scrolling 'logo panel' display similar to 'coverflow' threePartsView - Style used for YouTube with seperate display page onePartView - Single page list entry used for news feeds and menus with many feeds displayed and no graphics available 2MenusNColumnsView - Designed for EPG entries - Suited for long lists of entries btInfoView - Torrent download RSS view. Requires script initialisation first to add the required tables & fields weatherView - Weather RSS View weatherViewRss - Weather RSS alternate view weatherMapView - Guess lol... stockView - Shares and stocks view nullView - Not enabled on Xtreamer mediaCenterView - Not enabled on Xtreamer...yet
Example use:
<mediaDisplay name=photoView attribute1="" ... attributeN="" />
- photoView* (example)
Easily tweakable panel type display useful for channel selection and video feeds with thumbnails specific to each episode
- photoFocusView*
Scrolling 'Coverflow' type display useful for channel selection with thumbnails specific to each feed
- threePartsView*
Style used for Youtube Note: This style can help make feeds work which fail to play with no error message shown
- onePartView*
Suitable for blogs / news rss view or long lists of videos without thumbnails
Design attributes for all media names
These attributes can be applied to all styles without error. However, some effects are not defined on some views. All attributes are entered as follows: attribute="value" Attributes requiring a percentage as a value are marked from 0 to 100 where 100 = '100%' etc...
Header attributes
| Attribute | Allowed Values | Description of usage | Example Value |
| showHeader | "yes" / "no" | Show header or not | showHeader="no" |
| headerXPC | 0 to 100 | Horizontal position of header | headerXPC="7" |
| headerYPC | 0 to 100 | Vertical position of header | headerYPC="10" |
| headerWidthPC | 0 to 100 | Header width | headerWidthPC="0" |
| headerHeightPC | 0 to 100 | Proportion of Header height | headerHeightPC="4" |
| headerImageXPC | 0 to 100 | Header image proportional horizontal position | headerImageXPC="10" |
| headerImageYPC | 0 to 100 | Header image proportional vertical position | headerImageYPC="10" |
| headerImageWidthPC | 0 to 100 | Proportion of Header image width | headerImageWidthPC="95" |
| headerImageHeightPC | 0 to 100 | Proportion of Header image height | headerImageHeightPC="10" |
| headerCapXPC | 0 to 100 | Header image proportional horizontal position | headerCapXPC="10" |
| headerCapYPC | 0 to 100 | Header image proportional vertical position | headerCapYPC="10" |
| headerCapWidthPC | 0 to 100 | Header caption proportional width | headerCapWidthPC="0" |
| headerCapHeight | 0 to 100 | Header caption proportional width | headerCapHeightPC="0" |
| headerColor | RGB Values rrr:ggg:bbb | Colour of header | headerColor="110:110:0" |
| headerFontSize | ? | Size of header fonts | headerFontSize |
| headerCornerRounding | "yes" / "no" | Round corners on headers | headerCornerRounding="yes" |
Caption attributes
| Attribute | Allowed Values | Description of usage | Example Value |
| capXPC | 0 to 100 | Caption horizontal proportional position | capXPC="0" |
| capYPC | 0 to 100 | Caption vertical proportional position | capYPC="7" |
| capWidthPC | 0 to 100 | Width of caption | capWidthPC="70" |
| capHeightPC | 0 to 100 | Height of caption | capHeightPC="7" |
Menu attributes
| Attribute | Allowed Values | Description of usage | Example Value |
| menuXPC | 0 to 100 | Menu horizontal position | menuXPC="5" |
| menuYPC | 0 to 100 | Menu vertical position | menuYPC="5" |
| menuWidthPC | 0 to 100 | Width of menu | menuWidthPC="15" |
| menuHeightPC | 0 to 100 | Height of menu | menuHeightPC="15" |
| menuImageXPC | 0 to 100 | Menu image horizontal position | menuImageXPC="5" |
| menuImageYPC | 0 to 100 | Menu image vertical position | menuImageYPC="5" |
| menuImageWidthPC | 0 to 100 | Width of menu image | menuImageWidthPC="15" |
| menuImageHeightPC | 0 to 100 | Height of menu image | menuImageHeightPC="15" |
| menuOffsetXPC | 0 to 100 | Proportion of gap left & right of menu | menuOffsetXPC="8" |
| menuOffsetYPC | 0 to 100 | Proportion of gap above & below menu | menuOffsetYPC="12" |
| menuBorderColor | RGB Values rrr:ggg:bbb | Colour of menu border | menuBorderColor="20:20:20" |
| selectMenuOnRight | "yes" / "no" | Should select menu display on right side? | selectMenuOnRight="yes" |
| menuPerPage | 0 to ? | # of menus to display per page | menuPerPage="1" |
| menuCornerRounding | "yes" / "no" | Round corners of menu | menuCornerRounding |
Item attributes
| Attribute | Allowed Values | Description of usage | Example Value |
| drawItemText | "yes" / "no" | Display Item description 'on' item | drawItemText="no" |
| slidingItemText | "yes" / "no" | Use sliding item text | slidingItemText="yes" |
| itemXPC | 0 to 100 | Horizontal proportion of item | itemXPC="20" |
| itemYPC | 0 to 100 | Vertical proportion of item | itemYPC="18" |
| itemWidthPC | 0 to 100 | Proportional width of item to display | itemWidthPC="12.5" |
| itemHeightPC | 0 to 100 | Proportional height of item to display | itemHeightPC="33.3" |
| itemImageXPC | 0 to 100 | Proportion of item image width to display | itemImageXPC="12" |
| itemImageYPC | 0 to 100 | Proportion of item image height to display | itemImageYPC="18" |
| itemImageWidthPC | 0 to 100 | Proportion of item image width displayed | itemImageWidthPC="7" |
| itemImageHeightPC | 0 to 100 | Proportion of item image height displayed | itemImageHeightPC="8" |
| itemOffsetXPC | 0 to 100 | Horizontal offset of item | itemOffsetXPC="9" |
| itemOffsetYPC | 0 to 100 | Vertical offset of item | itemOffsetYPC="49" |
| itemBorderColor | RGB Values rrr:ggg:bbb | Colour of item border | itemBorderColor="0:0:0" |
| itemBackgroundColor | RGB Values rrr:ggg:bbb | Colour of item background | itemBackgroundColor="0:0:0" |
| itemBackgroundWidthPC | 0 to 100 | Item background width | itemBackgroundWidthPC="13.5" |
| itemBackgroundHeightPC | 0 to 100 | Item background height | itemBackgroundHeightPC="35" |
| itemGap | 0 to ? | Gap between items on display | itemGap="0" |
| itemGapXPC | 0 to 100 | Horizontal proportion of gap between items | itemGapXPC="1.5" |
| itemGapYPC | 0 to 100 | Vertical proportion of gap between items | itemGapYPC="1" |
| itemPerPage | 0 to ? | Number of items to display per page | itemPerPage="9" |
| itemPerColumn | 0 to ? | Number of items to display per Column | itemPerColumn="3" |
| autoSelectItem | "yes" / "no" | Automatically select item on entry | autoSelectItem="no" |
| rollItems | "yes" / "no" | Use 'Roll items' function | rollItems="yes" |
| itemCornerRounding | "yes" / "no" | Round item corners | itemCornerRounding="yes" |
| itemAlignt | "left" / "center"(?) / "right" | Item alignment (Just text or..?) | itemAlignt="left" |
Focus attributes
| Attribute | Allowed Values | Description of usage | Example Value |
| forceFocusOnItem | "yes" / "no" | Force item focus on | forceFocusOnItem="no" |
| imageFocus | null / image url | Image to display when item state = in focus | imageFocus=null |
| imageUnFocus | null / image url | Image to display when item state = not in focus | imageUnFocus=null |
| imageParentFocus | null / ? | ? | imageParentFocus=null |
| parentFocusFontColor | RGB Values xxx:xxx:xxx | ? | parentFocusFontColor="100:0:100" |
| focusBorderColor | RGB Values xxx:xxx:xxx | Colour of item border when item in focus | focusBorderColor="0:0:0" |
| unFocusBorderColor | RGB Values xxx:xxx:xxx | Colour of item border when item is not in focus | unFocusBorderColor="0:0:0" |
| focusFontColor | RGB Values xxx:xxx:xxx | Colour of item text when item in focus focus | FontColor="255:255:255" |
| unFocusFontColor | RGB Values xxx:xxx:xxx | Colour of item text when item is not in focus | unFocusFontColor="110:110:110" |
| focusItemOffsetYPC | 0 to 100 | Offset height of selected item (Item in focus) | focusItemOffsetYPC="20" |
| focusItemWidthPC | 0 to 100 | Width of selected item (Item in focus) | focusItemWidthPC="23.43" |
| focusItemHeightPC | 0 to 100 | Height of selected item (Item in focus) | focusItemHeightPC="62.5" |
| focusItemBackgroundWidthPC | 0 to 100 | Width of background of selected item | focusItemBackgroundWidthPC="24" |
| focusItemBackgroundHeightPC | 0 to 100 | Height of background of selected item | focusItemBackgroundHeightPC="65" |
Popup (Warning message) attributes
| Attribute | Allowed Values | Description of usage | Example Value |
| popupXPC | 0 to 100 | Proportion of width of popup messages | popupXPC="7" |
| popupYPC | 0 to 100 | Proportion of height of popup messages | popupYPC="22" |
| popupWidthPC | 0 to 100 | Defined width of popup messages | popupWidthPC="15" |
| popupFontSize | 0 to ? | Size of font used on popup messages | popupFontSize="17" |
| popupBorderColor | RGB Values xxx:xxx:xxx | Border colour of popup messages | popupBorderColor="0:0:0" |
Suffix attributes
| Attribute | Allowed Values | Description of usage | Example Value' |
| suffixXPC | 0 to 100 | Proportional position suffix | suffixXPC="7" |
| suffixYPC | 0 to 100 | Proportional position of suffix | suffixYPC="22" |
| suffixBgColor | RGB Values | xxx:xxx:xxx Colour of suffix background | suffixBgColor="255:255:0" |
| suffixTextColor | RGB Values | xxx:xxx:xxx Colour of suffix font | suffixTextColor="255:255:0" |
| suffixClearImage | Image url(?) | 'Clear image' for suffix | suffixClearImage="http://example.com/test.jpg" |
| suffixClearImageXPC | 0 to 100 | Proportional horizontal position of suffix 'clear image' | suffixClearImageXPC="10" |
| suffixClearImageYPC | 0 to 100 | Proportional vertical position of suffix 'clear image' | suffixClearImageYPC="20" |
| suffixClearImageWPC | 0 to 100 | Proportional width of suffix 'clear image' | suffixClearImageWPC="30" |
| suffixClearImageHPC | 0 to 100 | Proportional height of suffix 'clear image' | suffixClearImageHPC="30" |
Side attributes
| Attribute | Allowed Values | Description of usage | Example Value |
| sideLeftWidthPC | 0 to 100 | Width of left side bar | sideLeftWidthPC="10" |
| sideRightWidthPC | 0 to 100 | Width of right side bar | sideRightWidthPC="0" |
| sideTopHeightPC | 0 to 100 | Height of top bar | sideTopHeightPC="20" |
| sideBottomHeightPC | 0 to 100 | Height of bottom bar | sideBottomHeightPC="10" |
| sideColorRight | RGB Values xxx:xxx:xxx | Colour of right side bar on screen display | sideColorRight="0:0:0" |
| sideColorLeft | RGB Values xxx:xxx:xxx | Colour of left side bar on screen display | sideColorLeft="0:0:0" |
| sideColorTop | RGB Values xxx:xxx:xxx | Colour of top bar on screen display | sideColorTop="0:0:0" |
| sideColorBottom | RGB Values xxx:xxx:xxx | Colour of bottom bar on screen display | sideColorBottom="0:0:0" |
Image attributes
| Attribute | Allowed Values | Description of usage | Example Value |
| imageRightSide | URL of image | Image to display on right side of screen | imageRightSide="http://123.com.image.jpg" |
| imageRightSide_tile | URL of image | Image to display tiled on right side of screen | imageRightSide_tile="http://123.com.image.jpg" |
| imageLeftSide | URL of image | Image to display on left side of screen | imageLeftSide="http://123.com.image.jpg" |
| imageLeftSide_tile | URL of image | Image to display tiled on left side of screen | imageLeftSide_tile="http://123.com.image.jpg" |
| imageBottomSide | URL of image | Image to display on bottom side of screen | imageBottomSide="http://123.com.image.jpg" |
| imageBottomSide_Tile | URL of image | Image to display tiled on bottom side of screen | imageBottomSide_Tile="http://123.com.image.jpg" |
| imageTopSide | URL of image | Image to display on top side of screen | imageBottomSide="http://123.com.image.jpg" |
| imageTopSide_Tile | URL of image | Image to display tiled on top side of screen | imageBottomSide_Tile="http://123.com.image.jpg" |
| imageBackground_tile | URL of image | Image to use tiled as background | imageBackground_tile="http://123.com.image.jpg" |
Idle image (Loading icon) attributes
| Attribute | Allowed Values | Description of usage | Example Value |
| idleImageXPC | 0 to 100 | Horizontal position of loading icon | idleImageXPC=45 |
| idleImageYPC | 0 to 100 | Vertical position of loading icon | idleImageYPC=42 |
| idleImageWidthPC | 0 to 100 | Width of animated loading icon | idleImageWidthPC=10 |
| idleImageHeightPC | 0 to 100 | Height of animated loading icon | idleImageHeightPC=16 |
Miscellaneous attributes
| Attribute | Allowed Values | Description of usage | Example Value |
| showDefaultInfo | "yes" / "no" | Should default information be shown? | showDefaultInfo="yes" |
| sliding | "yes" / "no" | Sliding items (yes) or static (no)? | sliding="no" |
| rowCount | 0 to ? | How many rows of items should be displayed | rowCount="1" |
| columnCount | 0 to ? | How many columns of items should be shown? | columnCount="5" |
| columnPerPage | 0 to ? | Number of columns per page | columnPerPage="3" |
| centerXPC | 0 to 100 | proportional horizontal position of center | centerXPC="50" |
| centerYPC | 0 to 100 | proportional vertical position of center | centerYPC="50" |
| cornerRounding | "yes" / "no" | Turn on rounding of object corners | cornerRounding="yes" |
| fontSize | ? | What size font should be used for display? | fontSize="15" |
| bottomYPC | 0 to 100 | Proportion of display allocated to 'bottom' (footer) | bottomYPC="10" |
| infoYPC | 0 to 100 | Proportion of display allocated to 'info' | infoYPC="85" |
| backgroundColor | RGB Values xxx:xxx:xxx | Colour assigned to main display background | backgroundColor="0:0:0" |
| mainPartColor | RGB Values xxx:xxx:xxx | Colour of main area | mainPartColor="0:0:0" |
| viewAreaWidthPC | 0 to 100 | Proportion of view area width | viewAreaWidthPC="70" |
Animated Loading Icon
Should be placed after view configuration ending and before closing encapsulation of </mediadisplay> e.g.:
/> <idleImage> image/POPUP_LOADING_01.jpg </idleImage> <idleImage> image/POPUP_LOADING_02.jpg </idleImage> <idleImage> image/POPUP_LOADING_03.jpg </idleImage> <idleImage> image/POPUP_LOADING_04.jpg </idleImage> <idleImage> image/POPUP_LOADING_05.jpg </idleImage> <idleImage> image/POPUP_LOADING_06.jpg </idleImage> </mediaDisplay>
Note: You can easily create your own custom loading icon in jpg or png format by simply uploading the images or storing locally in your scripts directory for example and referencing them in your rss as above or by replacing the original icons above with your own - I would suggest the first route is both easier and safer for novices.
Additional xDisplay definitions
Several areas of the screen layout can be individually configured so that 'global' attributes can be applied in different ways to certain parts of the display. The size and structure of these display areas are defined within the main <item> <mediaDisplay section which must precede the definitions for the display element itself.
'itemDisplay' Element Attributes
<itemDisplay> will draw widget inside the item area, item area is decided by mediaDisplay attributes
Example:
<itemDisplay>
<image redraw="yes" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="80">
<script>
getItemInfo(-1, "thumbnail");
</script>
</image>
<text redraw="yes" fontFile=".../fonts/my_font.ttf" fontSize="12" alignt="justify" lines="2"
offsetXPC="0" offsetYPC="80" widthPC="100" heightPC="20"
backgroundColor="-1:-1:-1" foregroundColor="255:255:255">
<script>
getItemInfo(-1, "title");
</script>
</text>
</itemDisplay>
'infoDisplay' Element Attributes
TODO!
'backgroundDisplay' Element Attributes
Controls various sections of main display area. Example usage:
.... <backgroundDisplay> <image offsetXPC=0 offsetYPC=0 widthPC=100 heightPC=100>/tmp/usbmounts/sda1/scripts/backgrounds/bg_adult.jpg</image> </backgroundDisplay> </mediaDisplay>
Advanced RSS Scripting
The Realtek media players have the function to use more advanced controls and scripting within RSS feeds which gives us enhanced functionality such as interacting with data sources and databases as well as performing simple if-then-else type conditional checks. This allows us to reconfigure the way we interact with RSS feeds to allow us to configure menu actions and extra options for remote control button presses or similar. [edit] <script> command variables within RSS feeds For usage in for example: <onEvent> (TODO - Add more examples) These commands can be called from RSS <script>'s to call functions or interact with the Xtreamer databases such as those used by DVDPlayer to queue playback items.
Supported Remote Keys
These Keys can be captured by RSS method getUserInput() Sample Code:
<script>
userInput = getUserInput();
if (userInput == "pageup")
print("userInput is pageup"); /* print() debug output on console */
else
print("userInput is not pageup");
</script>
| Key | Value (returned string of currentUserInput()) | Value (returned string of currentUserInput() on prodigy) |
| Home | GUIDE | TODO!! |
| 1 | 1 | one |
| 2 | 2 | two |
| 3 | 3 | three |
| 4 | 4 | four |
| 5 | video_search | five |
| 6 | (not supported) | six |
| 7 | setup | seven |
| 8 | 8 | eight |
| 9 | (not supported) | TVOUT |
| Info | DISPLAY | display |
| 0 | 0 | zero |
| Return | RET | return |
| Up (arrow) | U | up |
| Down (arrow) | D | down |
| Left (arrow) | L | left |
| Right (arrow) | R | right |
| Enter | ENTR | TODO!! |
| PGUP | PU | TODO!! |
| PGDN | PD | TODO!! |
| Play | video_play | play |
| Stop | video_stop | stop |
| Rewind | video_frwd | frwd |
| Fast Forward | video_ffwd | ffwd |
| Vol+ | video_volume_up | TODO!! |
| Vol- | video_volume_down | TODO!! |
| A-B | video_abrepeat | TODO!! |
| Repeat | video_repeat | repeat |
| Mute | video_volume_mute | mute |
prodigy-3d-keyboard-rss-mappings
Implementation sample to support Xtreamer family (MK1, Pro,... and SW2, prodigy)
userInput = currentUserInput();
if ( userInput == "video_search" || userInput == "five" || userInput == "option_blue" ) {
...
}
if ( userInput == "1" || userInput == "one" || userInput == "option_red" ) {
...
}
if ( userInput == "3" || userInput == "three" || userInput == "option_yellow" ) {
...
}
if ( userInput == "4" || userInput == "four" ) {
...
}
if ( userInput == "8" || userInput == "eight" ) {
...
}
if ( userInput == "D" || userInput == "down" ) {
...
}
if ( userInput == "U" || userInput == "up" ) {
...
}
All keys you can find in Talk:Xtreamer_RSS_Guide
Null commands / inputs / functions
currentUserInput() executeScript() redrawDisplay() playURL(..)
Events which can have scripted actions
<onEnter></onEnter> <onExit></onExit> <onRefresh></onRefresh> <onClick></onClick> <onUserInput></onUserInput>
Example scripted actions for <onUserInput>
<onUserInput>
<script>
userInput = currentUserInput();
if (userInput == "pagedown" || userInput == "pageup")
{
...do something
"true"; <- "true" = the user input should be not processed to application
}
else
"false"; <- the user input should be processed to application for further actions
<script>
<onUserInput>
Function calls / actions
| function | description | example |
| sprintf1 | ||
| Integer1 | ||
| sprintf | ||
| Integer | ||
| getUserInput() | fetch the corresponding user input.
input : "left";"right";"up";"pageup"; "pagedown";"down";"enter";"return"; "edit";"download";"video_completed"; "video_stop";"video_pause"; "video_ffwd";"video_sfwd";"video_srwd"; "video_repeat";"video_abrepeat"; |
<script>
userInput = getUserInput();
if (userInput == "pagedown")
print("userInput is pagedown");
else
print("userInput is not pagedown");
</script>
|
| getInput | ||
| currentUserInput | fetch the current user input.
userInput: "left";"right";"up";"pageup"; "pagedown";"down";"enter"; "return";"edit";"download"; "video_completed";"video_stop"; "video_pause";"video_ffwd"; "video_sfwd";"video_srwd"; "video_repeat";"video_abrepeat"; |
<script>
userInput = currentUserInput();
if (userInput == "pageup")
print("userInput is pageup");
else
print("userInput is not pageup");
</script>
|
| postMessage | execution the command:
"enter" "left";"right"; "up";"pageup";"pagedown"; "down";"enter";"return"; "edit";"download"; "video_completed";"video_stop"; "video_pause";"video_ffwd"; "video_sfwd";"video_srwd"; "video_repeat";"video_abrepeat"; |
<script>
index = getFocusItemIndex();
if (index > 0) {
postMessage("enter");
}
</script>
|
| setRefreshTime | ||
| getURL | ||
| getCSVFromURL | ||
| getItemInfo | ||
| getPageInfo | ||
| getQueryItemIndex | ||
| getQueryMenuIndex() | ||
| getFocusItemIndex() / getFocusMenuIndex() | fetch the index (idx) of the item/munu which is in focus |
idx = getFocusItemIndex(); / getFocusMenuIndex(); |
| setFocusMenuIndex(idx) | set item index (idx) of the menu which should be in Focus |
setFocusMenuIndex(0); |
| getSelectedItemIndex | ||
| getDrawingItemState | fetch the state of the item which is be Drawing.
Item's state,such as: "focus" "unfocus" "inactive" |
<script> state_string = getDrawingItemState(); </script> |
| getItemInfoArray | ||
| catStringArray | ||
| getStringArrayAt( Array, index ); | get the text of specific element from array( that has "\n" as delimiter ) |
idArray = null; idArray = pushBackStringArray(idArray, "1"); idArray = pushBackStringArray(idArray, "2"); the idArray will contain "1\n2\n". Use getStringArrayAt(idArray, 1); will return 2. |
| deleteStringArrayAt ( stringArray, index ); | Return value is the new StringArray. If index = -1 mean current item index. Default value is -1. |
old_stringArray = "1\n2\n" new_stringArray = deleteStringArrayAt(old_stringArray, 0); new_stringArray = "2\n" |
| addItem | ||
| redrawDisplay | ||
| loadXMLFile | ||
| getXMLElementCount | ||
| getXMLText ( "element1", element1_count, "element2", element2_count,"element3", element3_count, ... ) | get the text of specific element from global xml dom object
parameter = name string of specific element |
<script>
content=getXMLText("element1","element2",1,"element3");
</script>
If xml contain: <element1> <element2> <element3>Hello ! </element3> </element2> <element2> <element3>Hello world !</element3> </element2> <element1> getXMLText will return content = "Hello world!" NOTE: getXMLText("element1", "element2", is the same as getXMLText("element1", 0, "element2", ...) 0 is the default element index! |
| getXMLAttribute("element1", "element2", "attribute"); | get the attribute of a specific element from global xml dom object.
The last parameter is the attribute element. |
<script>
attribute=getXMLAttribute("element1","element2",1,"url");
</script>
If rss contain: <element1> <element2 url="url 1" /> <element2 url="url 2" /> <element2 url="url 3" /> </element1> getXMLAttribute will return attribute = "url 2" |
| pushBackStringArray ( stringArray, stringElement ) | Function append an stringElement to the end of an existing string array, A stringArray is a text string separated with \n. | see getStringArrayAt for sample. |
| getURLforStock | ||
| selectMenu | ||
| executeScript | ||
| jumpToLink | ||
| setItemFocus | ||
| writeStringToFile | ||
| playItemURL | ||
| playAtTime | ||
| getPlaybackStatus | ||
| getCachedStreamDataSize | ||
| setVoutDisplay | ||
| GetScreenSaverStatus | ||
| SetScreenSaverStatus | ||
| isInternalHDDExist | ||
| updatePlaybackProgress | ||
| readStringFromFile | ||
| getStoragePath | ||
| drawImageOnScreen | ||
| drawImage | ||
| urlEncode | ||
| menuCmd | ||
| deleteItem | ||
| setFocusItemIndex | ||
| setFocusMenuIndex | ||
| showIdle() | show the idle image |
showIdle(); |
| cancelIdle() | cancel the showing of idle image |
dlok = loadXMLFile(topUrl);
if (dlok != null)
print("success");
else
{
print("Download xml file fail: ", currentUrl);
cancelIdle();
}
|
| convertSpaceInUrl | ||
| prepareAnimation | ||
| getErrorCode | ||
| doModalRss | ||
| setReturnString |
Some example usage
xmlfile = "/tmp/usbmounts/sda1/scripts/settings.xml";
download_ok = loadXMLFile( xmlfile );
itemSize = getXMLElementCount("video","item");
if xmlfile has the following structure itemSize should be 5.
<video>
<item>
</item>
<item>
</item>
<item>
</item>
<item>
</item>
<item>
</item>
</video>
totalItems = getXMLText("video", "totalResults");
if xmlfile has the following structure totalItems should be 2.
<video>
<totalResults>2</totalResults>
</video>
itemsPerPage = getXMLText("video", "itemsPerPage");
if xmlfile has the following structure itemsPerPage should be 45.
<video>
<itemsPerPage>45</itemsPerPage>
</video>
count = 3;
title = getXMLText("video","item", count, "title");
if xmlfile has the following structure title should be "Title 4",
because count start with 0, title of item0 = "Title 1".
<video>
<item>
<title>Title 1</title>
</item>
<item>
<title>Title 2</title>
</item>
<item>
<title>Title 3</title>
</item>
<item>
<title>Title 4</title>
</item>
<item>
<title>Title 5</title>
</item>
</video>
id = getXMLText("video","item",count,"vid");
see example with getXMLText("video","item", count, "title");
thumbnail = getXMLText("video","item",count,"thumbnail");
see example with getXMLText("video","item", count, "title");
titleArray = pushBackStringArray(titleArray, title); example: titleArray = pushBackStringArray(titleArray, "Title 1"); titleArray = pushBackStringArray(titleArray, "Title 2"); titleArray = pushBackStringArray(titleArray, "Title 3"); titleArray = pushBackStringArray(titleArray, "Title 4"); titleArray has the following content: "Title 1\nTitle 2\nTitle 3\nTitle 4\n"
idArray = pushBackStringArray(idArray, id); thumbnailArray = pushBackStringArray(thumbnailArray, thumbnail);
Supported <link> protocols
<link>upnp://</link> <link>rtsp://</link> <link>picasa://</link> <link>sql://</link> <link>rss_file://./scripts/video_guide.rss</link> <link>btpd://list</link> <link>rss_command://search</link> <link>file:///tmp/usbmounts</link> <link>ipod:///tmp/usbmounts</link> <link>http://</link> <link>syscall://SwitchAPTo/TV</link> <link>syscall://SwitchAPTo/PlayVideo</link> <link>syscall://SwitchAPTo/FileCopy</link> <link>syscall://SwitchAPTo/Browser</link> <link>syscall://SwitchAPTo/GBrowser</link> <link>syscall://SwitchAPTo/SetupMenu</link> <link>syscall://SwitchAPTo/TimerRecord</link> <link>syscall://SwitchAPTo/TitleList</link>
AP Functions / classes
VideoPlaybackAP VideoPlaybackSearchMenu VideoPlaybackSubTitleMenu VideoPlaybackSubTitleMenu ScreenSaverAP HDDEditingChoiceAP RootAP - Calls main.cpp - aka initial root app call (Alias TV) GBrowserAP FileCopyAP - Calls the file manager UI (Alias FileCopy) PopupMenuAP - Calls the popup display of text cached in /proc/sys/vm/drop_caches
APs are given some aliases and the actual functions to call are named differently in various Relatek media players. Each class represents a differing .cpp file entry. TODO - Seperate section for AP calls detailing all of the entries and the implementation of the arrays and title arrays (include aliases such as TV etc..) also the interaction with DVDPlayer specified more clearly and the functionality of the database interaction with the core modules.
Item Templates
Item templates <item_template> are used to define a framework for on the fly additions to temporary RSS feeds used for a variety of reasons (Such as dynamic search results). There is scope for development of this area....
<rss>
<item_template>
<displayTitle>
<script>
getStringArrayAt(titleArray , -1);
</script>
</displayTitle>
<media:thumbnail>
<script>
url = getStringArrayAt(thumbnailArray , -1);
print("thumbnail:");
print(url);
url;
</script>
</media:thumbnail>
<playURL>
<script>
url = "http://URL_folder" + getStringArrayAt(fileArray , -1);
print("playURL:");
print(url);
url = getXMLText("video","durl","url");
print("real playURL:");
print(url);
url;
</script>
</playURL>
<media:content type="image/video" />
<onClick>
print("onClick");
</onClick>
</item_template>
<channel>
<title>Sina Film</title>
<link>http://127.0.0.1/media/sda1/scripts_local/sina_dp.rss</link>
<media:thumbnail url="image/logoTVGuide.gif" width="120" height="90" />
<itemSize>
<script>
itemSize;
</script>
</itemSize>
</channel>
</rss>
One more working script!
<?xml version='1.0' ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> <script> titleArray = null; titleArray = pushBackStringArray(titleArray, "Title 1"); titleArray = pushBackStringArray(titleArray, "Title 2"); titleArray = pushBackStringArray(titleArray, "Title 3"); bgArray = null; bgArray = pushBackStringArray(bgArray, "/tmp/usbmounts/sda1/scripts/image/background.jpg"); bgArray = pushBackStringArray(bgArray, "/tmp/usbmounts/sda1/scripts/image/background.jpg"); bgArray = pushBackStringArray(bgArray, "/tmp/usbmounts/sda1/scripts/image/background.jpg"); imgArray = null; imgArray = pushBackStringArray(imgArray, "/tmp/usbmounts/sda1/scripts/image/defaultpostermovies.jpg"); imgArray = pushBackStringArray(imgArray, "/tmp/usbmounts/sda1/scripts/image/defaultpostermovies.jpg"); imgArray = pushBackStringArray(imgArray, "/tmp/usbmounts/sda1/scripts/image/defaultpostermovies.jpg"); linkArray = null; linkArray = pushBackStringArray(linkArray, "link_1.rss"); linkArray = pushBackStringArray(linkArray, "link_2.rss"); linkArray = pushBackStringArray(linkArray, "link_3.rss"); </script> <mediaDisplay name="photoView" width="200" fontSize="" rowCount="2" columnCount="7" menuBorderColor="20:20:20" menuOffsetYPC="8" menuOffsetXPC="8" menuWidthPC="100" rollItems="yes" sideColorBottom="0:0:0" sideColorTop="0:0:0" sideColorLeft="0:0:0" sideColorRight="0:0:0" itemImageXPC="10" itemImageYPC="0" itemOffsetXPC="7" itemOffsetYPC="20" backgroundColor="0:0:0" itemBorderColor="0:255:180" itemCornerRounding="yes" sliding="yes" idleImageXPC="45" idleImageYPC="42" idleImageWidthPC="7" idleImageHeightPC="16" > <idleImage> image/POPUP_LOADING_01.jpg </idleImage> <idleImage> image/POPUP_LOADING_02.jpg </idleImage> <idleImage> image/POPUP_LOADING_03.jpg </idleImage> <idleImage> image/POPUP_LOADING_04.jpg </idleImage> <idleImage> image/POPUP_LOADING_05.jpg </idleImage> <idleImage> image/POPUP_LOADING_06.jpg </idleImage> <backgroundDisplay> <image redraw="yes" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100"> <script> getStringArrayAt(bgArray , -1); </script> </image> </backgroundDisplay> <itemDisplay> <image redraw="yes" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="100"> <script> getStringArrayAt(imgArray , -1); </script> </image> </itemDisplay> </mediaDisplay> <item_template> <displayTitle> <script> getStringArrayAt(titleArray , -1); </script> </displayTitle> <link> <script> getStringArrayAt(linkArray , -1); </script> </link> </item_template> <channel> <title>TEST</title> <link>test.rss</link> <media:thumbnail url="./image/moviewall.jpg" width="120" height="90" /> <itemSize> <script> 3; </script> </itemSize> </channel> </rss>
Example <item> feed from the official RSS Feed
<item> <title>Movies</title> <link>http://live.mvix.net/x_live2/scripts/videos/movies.rss</link> <mediaDisplay name=photoView rowCount=2 columnCount=5 drawItemText="no" menuBorderColor="0:0:0" sideColorBottom="0:0:0" sideColorTop="0:0:0" iteImageXPC="10" itemOffsetXPC="10" backgroundColor="0:0:0" sliding="yes" idleImageXPC=45 idleImageYPC=42 idleImageWidthPC=10 idleImageHeightPC=16 > <idleImage> image/POPUP_LOADING_01.jpg </idleImage> <idleImage> image/POPUP_LOADING_02.jpg </idleImage> <idleImage> image/POPUP_LOADING_03.jpg </idleImage> <idleImage> image/POPUP_LOADING_04.jpg </idleImage> <idleImage> image/POPUP_LOADING_05.jpg </idleImage> <idleImage> image/POPUP_LOADING_06.jpg </idleImage> </mediaDisplay> </item>
Credits
Special thanks go to the following in no particular order for their contributions to the Xtreamer RSS scene:
- CaP
- Nedstar
- Exe
- Vonck
- XenDE
- Rafal123
- Csb
- SS - Thx for photos :)
- Tweakradje
- Welph
- Conkast
- Xdreamer
- Mrs. CaP (For having the patience of a saint :))
- Xtreamer staff - For listening to us all

