The CODService class
Support in HbbTV
Available since: Not implemented in HbbTV
The CODService class is a subclass of CODFolder that represents a subscription CoD service. A subscription CoD service is similar to a folder, except that:
- The service SHALL be purchased in its entirety, rather than purchasing individual items from the service.
- Business rules may prevent browsing of the content within a service unless the service has already been purchased.
A CODService MAY contain a number of assets, folders and services.
Note: The lookupMetadata() method and uid property has been removed from this class.
Properties
readonly Integer length |
The number of items in the current page of the service. |
readonly Integer currentPage |
The page number of the currently-available results, as specified in the last call to getPage(). If getPage() has not yet been called, the value of this property SHALL be undefined. |
readonly Integer pageSize |
The number of items that were requested from the content catalogue in a call to getPage(). This MAY be different from the number of items that are available (e.g. the last page in the collection). If getPage() has not yet been called, the value of this property SHALL be undefined. |
readonly Integer totalSize |
The total number of items in the service. This MAY be undefined until getPage() has been called. The value of this property may be given by the numOfItems attribute of the GroupInformation element representing this folder. |
readonly Integer type |
The type of the item, used to distinguish between the types of objects that may be contained in a folder in a CoD catalogue. This property SHALL always have the value 2 for a CoD service. |
readonly String uri |
The URI used to refer to the service. The value of this property is given by the BCG ServiceURL element that is a child of the ServiceInformation element that describes the service. |
readonly String name |
The name of the service that will be displayed to the user. The value of this property is given by the BCG Name element that is a child of the ServiceInformation element describing the service. |
readonly String description |
A description of the service, for display to an end user. The value of this property is given by the BCG ServiceDescription element that is a child of the ServiceInformation element describing the service. |
readonly String thumbnailUri |
The URI of an image associated with this service. The value of this property is derived from the value of the first Logo element that is a child of the BCG ServiceInformation element describing the service. If this element specifies anything other than the URL of an image, the value of this property SHALL be undefined. Alternatively, for services whose BCG description contains a RelatedMaterial element indicating a relationship of Promotional Still Image, the value of this property is given by the MediaURI element of the MediaLocator contained in that element. For assets without an appropriate RelatedMaterial or Logo element, the value of this property shall be undefined. |
readonly String previewUri |
The URI used to refer to a preview of the content. For services whose BCG description contains a RelatedMaterial element indicating a relationship of Trailer or Preview, the value of this property is given by the MediaURI element of the MediaLocator contained in that element. For services without an appropriate RelatedMaterial element, the value of this property SHALL be undefined. |
Methods
Boolean isReady() | |
Description | Check whether sufficient information is available to make a purchase. Due to the asynchronous nature of CoD catalogues, not all of the information required to play or purchase a CoD service may have been received by the OITF at any given time. If all of the required information is available, this method SHALL return true. Otherwise, this method SHALL request the missing information and return false. When the information is available, the application SHALL be notified via a ContentAction event with the action code 1. |
Object item( Integer index ) | ||
Description | Return the item at position index in the current page, or undefined if no item is present at that position. This function SHALL only return objects that are instances of CODAsset, CODFolder, or CODService. Applications SHALL be able to access items in the collection using array notation instead of calling this method directly. | |
Arguments | index | The index into the collection. |
void getPage( Integer page, Integer pageSize ) | ||
Description | Retrieve one page of the services contents. The application SHALL be notified by an event targeted at the services parent content catalogue when the data is available. Calls to this method SHALL cancel any outstanding requests. | |
Arguments | page | The number of the page for which data should be retrieved, indexed from zero. |
pageSize | The size of the page. |
void abort() | |
Description | Abort the current request for a new page of contents. Any results SHALL be removed (i.e. the value of the length property will be 0 and any calls to the item() method SHALL return undefined). |