Xtreamer RSS Guide

From Xtreamer

Jump to: navigation, search

Contents

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="" />

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
capXPC0 to 100Caption horizontal proportional positioncapXPC="0"
capYPC0 to 100Caption vertical proportional positioncapYPC="7"
capWidthPC0 to 100Width of captioncapWidthPC="70"
capHeightPC0 to 100Height of captioncapHeightPC="7"

Menu attributes

Attribute Allowed Values Description of usage Example Value
menuXPC0 to 100Menu horizontal positionmenuXPC="5"
menuYPC0 to 100Menu vertical positionmenuYPC="5"
menuWidthPC0 to 100Width of menumenuWidthPC="15"
menuHeightPC0 to 100Height of menumenuHeightPC="15"
menuImageXPC0 to 100Menu image horizontal positionmenuImageXPC="5"
menuImageYPC0 to 100Menu image vertical positionmenuImageYPC="5"
menuImageWidthPC0 to 100Width of menu imagemenuImageWidthPC="15"
menuImageHeightPC0 to 100Height of menu imagemenuImageHeightPC="15"
menuOffsetXPC0 to 100Proportion of gap left & right of menumenuOffsetXPC="8"
menuOffsetYPC0 to 100Proportion of gap above & below menumenuOffsetYPC="12"
menuBorderColorRGB Values rrr:ggg:bbbColour of menu bordermenuBorderColor="20:20:20"
selectMenuOnRight"yes" / "no"Should select menu display on right side?selectMenuOnRight="yes"
menuPerPage0 to ?# of menus to display per pagemenuPerPage="1"
menuCornerRounding"yes" / "no"Round corners of menumenuCornerRounding

Item attributes

Attribute Allowed Values Description of usage Example Value
drawItemText"yes" / "no"Display Item description 'on' itemdrawItemText="no"
slidingItemText"yes" / "no"Use sliding item textslidingItemText="yes"
itemXPC0 to 100Horizontal proportion of itemitemXPC="20"
itemYPC0 to 100Vertical proportion of itemitemYPC="18"
itemWidthPC0 to 100Proportional width of item to displayitemWidthPC="12.5"
itemHeightPC0 to 100Proportional height of item to displayitemHeightPC="33.3"
itemImageXPC0 to 100Proportion of item image width to displayitemImageXPC="12"
itemImageYPC0 to 100Proportion of item image height to displayitemImageYPC="18"
itemImageWidthPC0 to 100Proportion of item image width displayeditemImageWidthPC="7"
itemImageHeightPC0 to 100Proportion of item image height displayeditemImageHeightPC="8"
itemOffsetXPC0 to 100Horizontal offset of itemitemOffsetXPC="9"
itemOffsetYPC0 to 100Vertical offset of itemitemOffsetYPC="49"
itemBorderColorRGB Values rrr:ggg:bbbColour of item borderitemBorderColor="0:0:0"
itemBackgroundColorRGB Values rrr:ggg:bbbColour of item backgrounditemBackgroundColor="0:0:0"
itemBackgroundWidthPC0 to 100Item background widthitemBackgroundWidthPC="13.5"
itemBackgroundHeightPC0 to 100Item background heightitemBackgroundHeightPC="35"
itemGap0 to ?Gap between items on displayitemGap="0"
itemGapXPC0 to 100Horizontal proportion of gap between itemsitemGapXPC="1.5"
itemGapYPC0 to 100Vertical proportion of gap between itemsitemGapYPC="1"
itemPerPage0 to ?Number of items to display per pageitemPerPage="9"
itemPerColumn0 to ?Number of items to display per ColumnitemPerColumn="3"
autoSelectItem"yes" / "no"Automatically select item on entryautoSelectItem="no"
rollItems"yes" / "no"Use 'Roll items' functionrollItems="yes"
itemCornerRounding"yes" / "no"Round item cornersitemCornerRounding="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 onforceFocusOnItem="no"
imageFocusnull / image urlImage to display when item state = in focusimageFocus=null
imageUnFocusnull / image urlImage to display when item state = not in focusimageUnFocus=null
imageParentFocusnull / ??imageParentFocus=null
parentFocusFontColorRGB Values xxx:xxx:xxx?parentFocusFontColor="100:0:100"
focusBorderColorRGB Values xxx:xxx:xxxColour of item border when item in focusfocusBorderColor="0:0:0"
unFocusBorderColorRGB Values xxx:xxx:xxxColour of item border when item is not in focusunFocusBorderColor="0:0:0"
focusFontColorRGB Values xxx:xxx:xxxColour of item text when item in focus focusFontColor="255:255:255"
unFocusFontColorRGB Values xxx:xxx:xxxColour of item text when item is not in focusunFocusFontColor="110:110:110"
focusItemOffsetYPC0 to 100Offset height of selected item (Item in focus)focusItemOffsetYPC="20"
focusItemWidthPC0 to 100Width of selected item (Item in focus)focusItemWidthPC="23.43"
focusItemHeightPC0 to 100Height of selected item (Item in focus)focusItemHeightPC="62.5"
focusItemBackgroundWidthPC0 to 100Width of background of selected itemfocusItemBackgroundWidthPC="24"
focusItemBackgroundHeightPC0 to 100Height of background of selected itemfocusItemBackgroundHeightPC="65"

Popup (Warning message) attributes

Attribute Allowed Values Description of usage Example Value
popupXPC0 to 100Proportion of width of popup messagespopupXPC="7"
popupYPC0 to 100Proportion of height of popup messagespopupYPC="22"
popupWidthPC0 to 100Defined width of popup messagespopupWidthPC="15"
popupFontSize0 to ?Size of font used on popup messagespopupFontSize="17"
popupBorderColorRGB Values xxx:xxx:xxxBorder colour of popup messagespopupBorderColor="0:0:0"

Suffix attributes

Attribute Allowed Values Description of usage Example Value'
suffixXPC0 to 100Proportional position suffixsuffixXPC="7"
suffixYPC0 to 100Proportional position of suffixsuffixYPC="22"
suffixBgColorRGB Valuesxxx:xxx:xxx Colour of suffix backgroundsuffixBgColor="255:255:0"
suffixTextColorRGB Valuesxxx:xxx:xxx Colour of suffix fontsuffixTextColor="255:255:0"
suffixClearImageImage url(?)'Clear image' for suffixsuffixClearImage="http://example.com/test.jpg"
suffixClearImageXPC0 to 100Proportional horizontal position of suffix 'clear image'suffixClearImageXPC="10"
suffixClearImageYPC0 to 100Proportional vertical position of suffix 'clear image'suffixClearImageYPC="20"
suffixClearImageWPC0 to 100Proportional width of suffix 'clear image'suffixClearImageWPC="30"
suffixClearImageHPC0 to 100Proportional height of suffix 'clear image'suffixClearImageHPC="30"

Side attributes

Attribute Allowed Values Description of usage Example Value
sideLeftWidthPC0 to 100Width of left side barsideLeftWidthPC="10"
sideRightWidthPC0 to 100Width of right side barsideRightWidthPC="0"
sideTopHeightPC0 to 100Height of top barsideTopHeightPC="20"
sideBottomHeightPC0 to 100Height of bottom barsideBottomHeightPC="10"
sideColorRightRGB Values xxx:xxx:xxxColour of right side bar on screen displaysideColorRight="0:0:0"
sideColorLeftRGB Values xxx:xxx:xxxColour of left side bar on screen displaysideColorLeft="0:0:0"
sideColorTopRGB Values xxx:xxx:xxxColour of top bar on screen displaysideColorTop="0:0:0"
sideColorBottomRGB Values xxx:xxx:xxxColour of bottom bar on screen displaysideColorBottom="0:0:0"

Image attributes

Attribute Allowed Values Description of usage Example Value
imageRightSideURL of imageImage to display on right side of screenimageRightSide="http://123.com.image.jpg"
imageRightSide_tileURL of imageImage to display tiled on right side of screenimageRightSide_tile="http://123.com.image.jpg"
imageLeftSideURL of imageImage to display on left side of screenimageLeftSide="http://123.com.image.jpg"
imageLeftSide_tileURL of imageImage to display tiled on left side of screenimageLeftSide_tile="http://123.com.image.jpg"
imageBottomSideURL of imageImage to display on bottom side of screenimageBottomSide="http://123.com.image.jpg"
imageBottomSide_TileURL of imageImage to display tiled on bottom side of screenimageBottomSide_Tile="http://123.com.image.jpg"
imageTopSideURL of imageImage to display on top side of screenimageBottomSide="http://123.com.image.jpg"
imageTopSide_TileURL of imageImage to display tiled on top side of screenimageBottomSide_Tile="http://123.com.image.jpg"
imageBackground_tileURL of imageImage to use tiled as backgroundimageBackground_tile="http://123.com.image.jpg"

Idle image (Loading icon) attributes

Attribute Allowed Values Description of usage Example Value
idleImageXPC0 to 100Horizontal position of loading iconidleImageXPC=45
idleImageYPC0 to 100Vertical position of loading iconidleImageYPC=42
idleImageWidthPC0 to 100Width of animated loading iconidleImageWidthPC=10
idleImageHeightPC0 to 100Height of animated loading iconidleImageHeightPC=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"
rowCount0 to ?How many rows of items should be displayedrowCount="1"
columnCount0 to ?How many columns of items should be shown?columnCount="5"
columnPerPage0 to ?Number of columns per pagecolumnPerPage="3"
centerXPC0 to 100proportional horizontal position of centercenterXPC="50"
centerYPC0 to 100proportional vertical position of centercenterYPC="50"
cornerRounding"yes" / "no"Turn on rounding of object cornerscornerRounding="yes"
fontSize?What size font should be used for display?fontSize="15"
bottomYPC0 to 100Proportion of display allocated to 'bottom' (footer)bottomYPC="10"
infoYPC0 to 100Proportion of display allocated to 'info'infoYPC="85"
backgroundColorRGB Values xxx:xxx:xxxColour assigned to main display backgroundbackgroundColor="0:0:0"
mainPartColorRGB Values xxx:xxx:xxxColour of main areamainPartColor="0:0:0"
viewAreaWidthPC0 to 100Proportion of view area widthviewAreaWidthPC="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>

ImageSample: File:itemDisplaySample.jpg

'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
print
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
Personal tools