Player APIs (BrightScript & Ja...
...
Content Management Objects
roAssetCollection
6 min
this object is used to represent a collection of assets object creation the roassetcollection object is created with no parameters createobject("roassetcollection") you can populate an asset collection with individual calls to addasset() or addassets() you can also populate an asset collection using the rosyncspec getassets() method, as shown below assetcollection = createobject("roassetcollection") localcurrentsync = createobject("rosyncspec") if localcurrentsync readfromfile("local sync xml") then 	assetcollection = localcurrentsync getassets("download") endif iffailurereason getfailurereason() as string returns additional information if a method fails ifassetcollection addasset(asset info as dynamic) as boolean adds a single asset from an associative array or json formatted string if the argument is a string, it should match the format used for a single asset in a json sync spec returns true to indicate success and false to indicate failure if false is returned more detailed information is available by calling the getfailurereason method addassets(asset info array as dynamic) as boolean adds multiple assets from an enumerable object (an rolist , roarray , or string containing a json formatted array) that contains compatible associative arrays returns true to indicate success and false to indicate failure if false is returned more detailed information is available by calling the getfailurereason method getassetlist() as rolist returns an rolist instance containing associative arrays of asset metadata this method is not efficient and is, therefore, recommended for debugging and diagnostic purposes only each associative array contains the following true false 132false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type any "optional" fields that are specified when populating the pool must also be specified when retrieving assets from the pool (i e they become "mandatory" once they are used for an asset) for example, if the hash value is specified when fetching into the pool, then it must also be specified when attempting to refer to files in the pool hash algorithms true falsefalse left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type