Está en la página 1de 12

Xtreamer RSS Guide

From Xtreamer

Contents
1 Introduction 2 Standard RSS Structure 3 <item> Element Structure 4 Optional 'item' Element Attributes 4.1 Thumbnails - <media:thumbnail 4.2 'mediaDisplay' Element Attributes 4.2.1 Styles - <mediaDisplay name 4.3 Design attributes for all media names 4.3.1 Header attributes 4.3.2 Caption attributes 4.3.3 Menu attributes 4.3.4 Item attributes 4.3.5 Focus attributes 4.3.6 Popup (Warning message) attributes 4.3.7 Suffix attributes 4.3.8 Side attributes 4.3.9 Image attributes 4.3.10 Idle image (Loading icon) attributes 4.3.11 Miscellaneous attributes 4.4 Animated Loading Icon 5 Additional xDisplay definitions 5.1 'itemDisplay' Element Attributes 5.2 'infoDisplay' Element Attributes 5.3 'backgroundDisplay' Element Attributes 6 Advanced RSS Scripting 6.1 Supported Remote Keys 6.2 Null commands / inputs / functions 6.3 Events which can have scripted actions 6.4 Example scripted actions for <onUserInput> 6.5 Function calls / actions 6.6 Some example usage 7 Supported <link> protocols 8 AP Functions / classes 9 Item Templates 10 Example <item> feed from the official RSS Feed 11 Credits

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 photoFocusView threePartsView onePartView 2MenusNColumnsView btInfoView weatherView weatherViewRss weatherMapView stockView nullView mediaCenterView Large 'logo panel' type display Scrolling 'logo panel' display similar to 'coverflow' Style used for YouTube with seperate display page Single page list entry used for news feeds and menus with many feeds displayed and no graphics available Designed for EPG entries - Suited for long lists of entries Torrent download RSS view. Requires script initialisation first to add the required tables & fields Weather RSS View Weather RSS alternate view Guess lol... Shares and stocks view Not enabled on Xtreamer Not enabled on Xtreamer...yet

Example use:
<mediaDisplay name=photoView attribute1="" ... attributeN="" />

photoView* (example) (http://forum.xtreamer.net/download/file.php?id=1607) 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 showHeader headerXPC headerYPC headerWidthPC headerHeightPC headerImageXPC headerImageYPC headerImageWidthPC headerImageHeightPC headerCapXPC headerCapYPC headerCapWidthPC Allowed Values "yes" / "no" 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 Description of usage Show header or not Horizontal position of header Vertical position of header Header width Proportion of Header height Header image proportional vertical position Proportion of Header image width Proportion of Header image height Header image proportional vertical position Header caption proportional width Example Value showHeader="no" headerXPC="7" headerYPC="10" headerWidthPC="0" headerHeightPC="4" headerImageYPC="10" headerImageWidthPC="95" headerImageHeightPC="10" headerCapYPC="10" headerCapWidthPC="0"

Header image proportional horizontal position headerImageXPC="10"

Header image proportional horizontal position headerCapXPC="10"

headerCapHeight headerColor headerFontSize headerCornerRounding

0 to 100 RGB Values rrr:ggg:bbb ? "yes" / "no"

Header caption proportional width Colour of header Size of header fonts Round corners on headers

headerCapHeightPC="0" headerColor="110:110:0" headerFontSize headerCornerRounding="yes"

Caption attributes
Attribute capXPC capYPC capWidthPC capHeightPC Allowed Values 0 to 100 0 to 100 0 to 100 0 to 100 Description of usage Caption horizontal proportional position Caption vertical proportional position Width of caption Height of caption Example Value capXPC="0" capYPC="7" capWidthPC="70" capHeightPC="7"

Menu attributes
Attribute menuXPC menuYPC menuWidthPC menuHeightPC menuImageXPC menuImageYPC menuImageWidthPC menuImageHeightPC menuOffsetXPC menuOffsetYPC menuBorderColor selectMenuOnRight menuPerPage menuCornerRounding Allowed Values 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 RGB Values rrr:ggg:bbb "yes" / "no" 0 to ? "yes" / "no" Description of usage Menu horizontal position Menu vertical position Width of menu Height of menu Menu image horizontal position Menu image vertical position Width of menu image Height of menu image Proportion of gap left & right of menu Proportion of gap above & below menu Colour of menu border Should select menu display on right side? # of menus to display per page Round corners of menu Example Value menuXPC="5" menuYPC="5" menuWidthPC="15" menuHeightPC="15" menuImageXPC="5" menuImageYPC="5" menuImageWidthPC="15" menuImageHeightPC="15" menuOffsetXPC="8" menuOffsetYPC="12" menuBorderColor="20:20:20" selectMenuOnRight="yes" menuPerPage="1" menuCornerRounding

Item attributes
Attribute drawItemText slidingItemText itemXPC itemYPC itemWidthPC itemHeightPC itemImageXPC itemImageYPC itemImageWidthPC itemImageHeightPC itemOffsetXPC itemOffsetYPC itemBorderColor itemBackgroundColor itemBackgroundWidthPC itemBackgroundHeightPC itemGap itemGapXPC itemGapYPC itemPerPage itemPerColumn autoSelectItem rollItems itemCornerRounding itemAlignt Allowed Values "yes" / "no" "yes" / "no" 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 0 to 100 RGB Values rrr:ggg:bbb RGB Values rrr:ggg:bbb 0 to 100 0 to 100 0 to ? 0 to 100 0 to 100 0 to ? 0 to ? "yes" / "no" "yes" / "no" "yes" / "no" Description of usage Display Item description 'on' item Use sliding item text Horizontal proportion of item Vertical proportion of item Proportional width of item to display Proportional height of item to display Proportion of item image width to display Proportion of item image height to display Proportion of item image width displayed Proportion of item image height displayed Horizontal offset of item Vertical offset of item Colour of item border Colour of item background Item background width Item background height Gap between items on display Horizontal proportion of gap between items Vertical proportion of gap between items Number of items to display per page Number of items to display per Column Automatically select item on entry Use 'Roll items' function Round item corners Example Value drawItemText="no" slidingItemText="yes" itemXPC="20" itemYPC="18" itemWidthPC="12.5" itemHeightPC="33.3" itemImageXPC="12" itemImageYPC="18" itemImageWidthPC="7" itemImageHeightPC="8" itemOffsetXPC="9" itemOffsetYPC="49" itemBorderColor="0:0:0" itemBackgroundColor="0:0:0" itemBackgroundWidthPC="13.5" itemBackgroundHeightPC="35" itemGap="0" itemGapXPC="1.5" itemGapYPC="1" itemPerPage="9" itemPerColumn="3" autoSelectItem="no" rollItems="yes" itemCornerRounding="yes" itemAlignt="left"

"left" / "center"(?) / "right" Item alignment (Just text or..?)

Focus attributes
Attribute forceFocusOnItem imageFocus Allowed Values "yes" / "no" null / image url Description of usage Force item focus on Image to display when item state = in focus Example Value forceFocusOnItem="no" imageFocus=null

imageUnFocus imageParentFocus parentFocusFontColor focusBorderColor unFocusBorderColor focusFontColor unFocusFontColor focusItemOffsetYPC focusItemWidthPC focusItemHeightPC

null / image url null / ? RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx 0 to 100 0 to 100 0 to 100

Image to display when item state = not in focus ? ? Colour of item border when item in focus Colour of item border when item is not in focus Colour of item text when item in focus focus Colour of item text when item is not in focus Offset height of selected item (Item in focus) Width of selected item (Item in focus) Height of selected item (Item in focus) Width of background of selected item Height of background of selected item

imageUnFocus=null imageParentFocus=null parentFocusFontColor="100:0:100" focusBorderColor="0:0:0" unFocusBorderColor="0:0:0" FontColor="255:255:255" unFocusFontColor="110:110:110" focusItemOffsetYPC="20" focusItemWidthPC="23.43" focusItemHeightPC="62.5" focusItemBackgroundWidthPC="24" focusItemBackgroundHeightPC="65"

focusItemBackgroundWidthPC 0 to 100 focusItemBackgroundHeightPC 0 to 100

Popup (Warning message) attributes


Attribute popupXPC popupYPC popupWidthPC popupFontSize popupBorderColor Allowed Values 0 to 100 0 to 100 0 to 100 0 to ? RGB Values xxx:xxx:xxx Description of usage Proportion of width of popup messages Proportion of height of popup messages Defined width of popup messages Size of font used on popup messages Border colour of popup messages Example Value popupXPC="7" popupYPC="22" popupWidthPC="15" popupFontSize="17" popupBorderColor="0:0:0"

Suffix attributes
Attribute suffixXPC suffixYPC suffixBgColor suffixTextColor suffixClearImage suffixClearImageXPC suffixClearImageYPC suffixClearImageWPC suffixClearImageHPC Allowed Values 0 to 100 0 to 100 RGB Values RGB Values Image url(?) 0 to 100 0 to 100 0 to 100 0 to 100 Description of usage Proportional position suffix Proportional position of suffix xxx:xxx:xxx Colour of suffix background xxx:xxx:xxx Colour of suffix font 'Clear image' for suffix Example Value' suffixXPC="7" suffixYPC="22" suffixBgColor="255:255:0" suffixTextColor="255:255:0" suffixClearImage="http://example.com /test.jpg"

Proportional horizontal position of suffix 'clear suffixClearImageXPC="10" image' Proportional vertical position of suffix 'clear image' Proportional width of suffix 'clear image' Proportional height of suffix 'clear image' suffixClearImageYPC="20" suffixClearImageWPC="30" suffixClearImageHPC="30"

Side attributes
Attribute sideLeftWidthPC sideRightWidthPC sideTopHeightPC sideBottomHeightPC sideColorRight sideColorLeft sideColorTop sideColorBottom Allowed Values 0 to 100 0 to 100 0 to 100 0 to 100 RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx Description of usage Width of left side bar Width of right side bar Height of top bar Height of bottom bar Colour of right side bar on screen display Colour of left side bar on screen display Colour of top bar on screen display Colour of bottom bar on screen display Example Value sideLeftWidthPC="10" sideRightWidthPC="0" sideTopHeightPC="20" sideBottomHeightPC="10" sideColorRight="0:0:0" sideColorLeft="0:0:0" sideColorTop="0:0:0" sideColorBottom="0:0:0"

Image attributes
Attribute imageRightSide imageRightSide_tile imageLeftSide imageLeftSide_tile imageBottomSide imageBottomSide_Tile imageTopSide imageTopSide_Tile imageBackground_tile Allowed Values URL of image URL of image URL of image URL of image URL of image URL of image URL of image URL of image URL of image Description of usage Image to display on right side of screen Image to display tiled on right side of screen Image to display on left side of screen Image to display tiled on left side of screen Image to display on bottom side of screen Image to display on top side of screen Image to display tiled on top side of screen Image to use tiled as background Example Value imageRightSide="http://123.com.image.jpg" imageRightSide_tile="http://123.com.image.jpg" imageLeftSide="http://123.com.image.jpg" imageLeftSide_tile="http://123.com.image.jpg" imageBottomSide="http://123.com.image.jpg" imageBottomSide="http://123.com.image.jpg" imageBottomSide_Tile="http://123.com.image.jpg" imageBackground_tile="http://123.com.image.jpg"

Image to display tiled on bottom side of screen imageBottomSide_Tile="http://123.com.image.jpg"

Idle image (Loading icon) attributes

Attribute idleImageXPC idleImageYPC idleImageWidthPC idleImageHeightPC

Allowed Values 0 to 100 0 to 100 0 to 100 0 to 100

Description of usage Horizontal position of loading icon Vertical position of loading icon Width of animated loading icon Height of animated loading icon

Example Value idleImageXPC=45 idleImageYPC=42 idleImageWidthPC=10 idleImageHeightPC=16

Miscellaneous attributes
Attribute showDefaultInfo sliding rowCount columnCount columnPerPage centerXPC centerYPC cornerRounding fontSize bottomYPC infoYPC backgroundColor mainPartColor viewAreaWidthPC Allowed Values "yes" / "no" "yes" / "no" 0 to ? 0 to ? 0 to ? 0 to 100 0 to 100 "yes" / "no" ? 0 to 100 0 to 100 RGB Values xxx:xxx:xxx RGB Values xxx:xxx:xxx 0 to 100 Description of usage Should default information be shown? Sliding items (yes) or static (no)? Example Value showDefaultInfo="yes" sliding="no"

How many rows of items should be displayed rowCount="1" How many columns of items should be shown? columnCount="5" Number of columns per page columnPerPage="3" proportional horizontal position of center proportional vertical position of center Turn on rounding of object corners What size font should be used for display? Proportion of display allocated to 'bottom' (footer) Proportion of display allocated to 'info' Colour assigned to main display background Colour of main area Proportion of view area width centerXPC="50" centerYPC="50" cornerRounding="yes" fontSize="15" bottomYPC="10" infoYPC="85" backgroundColor="0:0:0" mainPartColor="0:0:0" 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> image/POPUP_LOADING_02.jpg <idleImage> image/POPUP_LOADING_03.jpg <idleImage> image/POPUP_LOADING_04.jpg <idleImage> image/POPUP_LOADING_05.jpg <idleImage> image/POPUP_LOADING_06.jpg </mediaDisplay>

</idleImage> </idleImage> </idleImage> </idleImage> </idleImage> </idleImage>

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:

'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 Home 1 2 3 4 5 6 7 8 9 Info 0 Return Up (arrow)

Value (returned string of currentUserInput()) Value (returned string of currentUserInput() on prodigy) GUIDE 1 2 3 4 video_search (not supported) setup 8 (not supported) DISPLAY 0 RET U TODO!! one two three four five six seven eight TVOUT display zero return up down left right TODO!! TODO!! TODO!!

Down (arrow) D Left (arrow) L Right (arrow) R Enter PGUP PGDN ENTR PU PD

Play Stop Rewind Vol+ VolA-B Repeat Mute

video_play video_stop video_frwd video_volume_up video_volume_down video_abrepeat video_repeat video_volume_mute

play stop frwd ffwd TODO!! TODO!! TODO!! repeat mute

Fast Forward video_ffwd

prodigy-3d-keyboard-rss-mappings (http://forum.xtreamer.net/topic/27656-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 sprintf1 Integer1 print sprintf Integer fetch the corresponding user input.
<script> 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"; userInput = getUserInput(); if (userInput == "pagedown") print("userInput is pagedown"); else print("userInput is not pagedown"); </script>

description

example

getUserInput()

getInput

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>

currentUserInput

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>

postMessage

setRefreshTime getURL getCSVFromURL getItemInfo getPageInfo getQueryItemIndex getQueryMenuIndex() getFocusItemIndex() / getFocusMenuIndex() setFocusMenuIndex(idx) getSelectedItemIndex fetch the state of the item which is be Drawing. getDrawingItemState Item's state,such as: "focus" "unfocus" "inactive"
<script> state_string = getDrawingItemState(); </script>

fetch the index (idx) of the item/munu which is in focus set item index (idx) of the menu which should be in Focus

idx = getFocusItemIndex(); / getFocusMenuIndex();

setFocusMenuIndex(0);

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 ); addItem redrawDisplay loadXMLFile getXMLElementCount

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"

<script> content=getXMLText("element1","element2",1,"element3"); </script>

If xml contain: getXMLText ( "element1", element1_count, "element2", element2_count,"element3", element3_count, ... ) get the text of specific element from global xml dom object
<element1> <element2> <element3>Hello ! </element3> </element2> parameter = name string of specific element <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! get the attribute of a specific element from getXMLAttribute("element1", global xml dom object. "element2", "attribute"); 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 ) 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();

Function append an stringElement to the end of an existing string array, A stringArray is a see getStringArrayAt for sample. text string separated with \n.

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 titleArray titleArray titleArray bgArray bgArray bgArray bgArray imgArray imgArray imgArray imgArray = = = = = = = = = = = = null; pushBackStringArray(titleArray, "Title 1"); pushBackStringArray(titleArray, "Title 2"); pushBackStringArray(titleArray, "Title 3");

null; pushBackStringArray(bgArray, "/tmp/usbmounts/sda1/scripts/image/background.jpg"); pushBackStringArray(bgArray, "/tmp/usbmounts/sda1/scripts/image/background.jpg"); pushBackStringArray(bgArray, "/tmp/usbmounts/sda1/scripts/image/background.jpg"); null; pushBackStringArray(imgArray, "/tmp/usbmounts/sda1/scripts/image/defaultpostermovies.jpg"); pushBackStringArray(imgArray, "/tmp/usbmounts/sda1/scripts/image/defaultpostermovies.jpg"); pushBackStringArray(imgArray, "/tmp/usbmounts/sda1/scripts/image/defaultpostermovies.jpg");

linkArray linkArray linkArray linkArray </script>

= = = =

null; pushBackStringArray(linkArray, "link_1.rss"); pushBackStringArray(linkArray, "link_2.rss"); pushBackStringArray(linkArray, "link_3.rss");

<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 Retrieved from "http://forum.xtreamer.net/mediawiki-1.15.1/index.php/Xtreamer_RSS_Guide" This page was last modified on 7 April 2012, at 20:54.

También podría gustarte