Method Summary
|
createRecordedContentSourceInstance
(
|
Returns a source instance for recorded content. |
|
getContent
(
|
Starts a best effort request for getting additional content information. Even if not all content information can be retrieved (e.g. content may not be available anymore) the operation will be set to completed. Any resulting ToiContentService.ToiContentInfo information will only include property values for the requested properties. |
| getSources ( ) → Array.<ToiContentService.ToiSourceInfo> |
Returns information about all available content sources. |
|
remove
(
|
Removes the corresponding content for the given content identifiers. |
|
removeProperties
(
|
Remove properties for the given content. |
|
search
(
|
Starts a search with the given condition. If multiple sources are included in the search, each source will only use the restrictions and properties it supports. The resulting ToiContentService.ToiContentInfo matches will only include property values for the requested properties. |
|
setProperties
(
|
Sets properties for the given content. |
Inherited Methods
|
addEventListener
(
|
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners. |
|
removeEventListener
(
|
This method removes an event listener for a specific event. |
Type Definitions
|
Map of conditions (ToiContentService.ToiCondition) needed for a match. Map containing ToiContentService.ToiCondition. |
|
|
|
|
|
Identifier that uniquely identifies some content. |
|
|
|
|
|
Identifies different types of content. |
|
|
Identifier for a metadata property. |
|
|
|
|
|
Map of properties (ToiContentService.ToiProperty). Map containing ToiContentService.ToiProperty. |
|
|
|
|
|
Different kind of property value types to indicate how to interpret property values when doing comparisons and sorting. |
|
|
Unique identifier of a source where searchable content exists. |
|
|
|
|
|
Type of content source |
|
|
|
|
Constants
- CONTENT_SOURCE_TYPE_DVR
- PROPERTY_CONTENT_BROKEN
- PROPERTY_CONTENT_DESCRIPTION
- PROPERTY_CONTENT_DURATION
- PROPERTY_CONTENT_FILESIZE
- PROPERTY_CONTENT_LONGDESCRIPTION
- PROPERTY_CONTENT_LOST_AND_FOUND
- PROPERTY_CONTENT_TIMESTAMP
- PROPERTY_CONTENT_TITLE
- PROPERTY_CONTENT_TYPE
- PROPERTY_CONTENT_URI
- PROPERTY_SOURCE_MAX_LIMIT
Methods
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.
Inherited From:
Parameters:
-
Name Type Description typenumber The event type of the event to subscribe to.
listenerToiEventListener The JavaScript function that will receive events.
Throws:
-
ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.
Returns a source instance for recorded content.
Parameters:
-
Name Type Description sourceId
[optional]ToiContentService.ToiSourceId The source identifier. If no source identifier is specified the platform will choose the first available recorded content source if any.
Throws:
-
ToiInvalidArgumentException Raised if
- the specified application identifier is invalid.
- the specified source identifier is not a recorded content source.
ToiInvalidPreconditionException Raised if
- the specified source identifier is not available.
- there is no recorded content source available (when sourceId is unspecified).
ToiNotEnoughResourcesException Raised if there are not enough resources to support creation of the content source instance.
Returns:
-
Type: ToiRecordedContentSource
The content source instance.
Starts a best effort request for getting additional content information. Even if not all content information can be retrieved (e.g. content may not be available anymore) the operation will be set to completed. Any resulting ToiContentService.ToiContentInfo information will only include property values for the requested properties.
Parameters:
-
Name Type Description callbacksAsyncCallback Object with callback functions for the asynchronous operation. The callbacks.onResult() will be invoked with any incremental results of type Array.<ToiContentService.ToiContentInfo>. The final and accumulated result will be available as the property 'result' in the operation object after callbacks.onCompleted() has been invoked.
parametersToiContentService.ToiContentParameters The content request parameters.
Throws:
-
ToiInvalidArgumentException Raised if
- the specified operation identifier is invalid.
- the parameters contain content identifiers that are invalid.
- the parameters contain properties that are invalid.
ToiInvalidPreconditionException Raised if the parameters contain content identifiers which belong to sources that are not available.
ToiNotEnoughResourcesException Raised if it was not enough system resources to perform the request.
Returns:
-
Type: ToiAsynchronousOperation
operation The asynchronous operation created by the function.
Returns information about all available content sources.
Returns:
-
Type: Array.<ToiContentService.ToiSourceInfo>
available content sources.
Removes the corresponding content for the given content identifiers.
Parameters:
-
Name Type Description callbacksAsyncCallback Object with callback functions for the asynchronous operation. No result is produced by this method, so callbacks.onResult() will not be invoked.
contentIdsArray.<ToiContentService.ToiContentId> (Or a single ToiContentService.ToiContentId.) The content identifiers. A single element can be passed directly and does not need to be passed in an array.
Throws:
-
ToiInvalidArgumentException Raised if the operation identifier or any content identifier is invalid.
ToiInvalidPreconditionException Raised if any content identifier belongs to a source that is not available.
ToiOperationNotSupportedException Raised if any content source does not support content removal.
Returns:
-
Type: ToiAsynchronousOperation
operation The asynchronous operation created by the function.
This method removes an event listener for a specific event.
Inherited From:
Parameters:
-
Name Type Description typenumber The event type of the event to remove the listener from.
listenerToiEventListener The JavaScript function that was previously added as an event listener.
Throws:
-
ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener has not previously been added.
Remove properties for the given content.
Parameters:
-
Name Type Description callbacksAsyncCallback Object with callback functions for the asynchronous operation. No result is produced by this method, so callbacks.onResult() will not be invoked.
contentIdsArray.<ToiContentService.ToiContentId> (Or a single ToiContentService.ToiContentId.) The content identifiers to make the change for. A single element can be passed directly and does not need to be passed in an array.
propertyIdsArray.<ToiContentService.ToiPropertyId> The properties to remove.
Throws:
-
ToiInvalidArgumentException Raised if
- the specified operation identifier is invalid.
- any content identifier is invalid.
- any property is invalid.
ToiInvalidPreconditionException Raised if any content identifier belongs to a source that is not available.
ToiOperationNotSupportedException Raised if any content source does not support removal of properties.
Returns:
-
Type: ToiAsynchronousOperation
operation The asynchronous operation created by the function.
Starts a search with the given condition. If multiple sources are included in the search, each source will only use the restrictions and properties it supports. The resulting ToiContentService.ToiContentInfo matches will only include property values for the requested properties.
Parameters:
-
Name Type Description callbacksAsyncCallback Object with callback functions for the asynchronous operation. The callbacks.onResult() will be invoked with any incremental results of type Array.<ToiContentService.ToiContentInfo>. The final and accumulated result will be available as the property 'result' in the operation object after callbacks.onCompleted() has been invoked.
parametersToiContentService.ToiSearchParameters The search parameters.
Throws:
-
ToiInvalidArgumentException Raised if
- the specified operation identifier is invalid.
- the parameters contain source identifiers that are invalid.
- the parameters contain properties that are invalid.
ToiInvalidPreconditionException Raised if the parameters contain source identifiers for sources that are not available.
ToiOperationNotSupportedException Raised if the parameters contain source properties that are not supported by any source.
ToiNotEnoughResourcesException Raised if it was not enough system resources to perform the search.
Returns:
-
Type: ToiAsynchronousOperation
operation The asynchronous operation created by the function.
Sets properties for the given content.
Parameters:
-
Name Type Description callbacksAsyncCallback Object with callback functions for the asynchronous operation. No result is produced by this method, so callbacks.onResult() will not be invoked.
contentIdsArray.<ToiContentService.ToiContentId> (Or a single ToiContentService.ToiContentId.) The content identifiers to make the change for. A single element can be passed directly and does not need to be passed in an array.
propertiesToiContentService.ToiPropertyMap The properties to modify.
Throws:
-
ToiInvalidArgumentException Raised if
- the specified operation identifier is invalid.
- any content identifier is invalid.
- any property is invalid.
ToiInvalidPreconditionException Raised if any content identifier belongs to a source that is not available.
ToiOperationNotSupportedException Raised if any content source does not support setting properties.
Returns:
-
Type: ToiAsynchronousOperation
operation The asynchronous operation created by the function.
Members
This is an Event identifier for ToiContentSourceAvailableEvent.
This notification is triggered when a new source is available.
This is an Event identifier for ToiContentSourceUnavailableEvent.
This notification is triggered when a source is no longer available. Any source instance(s) created for this source by the application must be released immediately using ToiContentSource#releaseInstance.
Identifier for audio (only) content type.
Identifier for image content type.
Identifier for video (possibly with audio) content type.
If the content has this property set it is deemed broken. Will be treated as ToiContentService.PROPERTY_TYPE_BOOLEAN. This property is currently read-only by applications.
The content description. Will be treated as ToiContentService.PROPERTY_TYPE_STRING.
The content duration in seconds. Will be treated as ToiContentService.PROPERTY_TYPE_INTEGER. This property is currently read-only for applications.
The content file size in bytes. Will be treated as ToiContentService.PROPERTY_TYPE_INTEGER. This property is currently read-only for applications.
The even more detailed content description. Will be treated as ToiContentService.PROPERTY_TYPE_STRING.
If the content has this property set it has been found by the source after being lost and has now been imported back into the source database. This could happen for example if the source database for some reason has been corrupted and reinitialized. Will be treated as ToiContentService.PROPERTY_TYPE_BOOLEAN.
The content creation timestamp (number of seconds since the UNIX epoch). Will be treated as ToiContentService.PROPERTY_TYPE_DATE.
The content name which is short and descriptive. Will be treated as ToiContentService.PROPERTY_TYPE_STRING.
The content type. Will be treated as ToiContentService.PROPERTY_TYPE_INTEGER, see ToiContentService.ToiContentType for possible values. This property is currently read-only for applications.
The content URI to use for playback or rendering. Will be treated as ToiContentService.PROPERTY_TYPE_STRING. This property is currently read-only for applications.
Value of true/false.
A positive integer value, seconds since the epoch.
A signed integer value.
Any string value.
Defines a matching condition for a single property.
Struct fields
| Name | Description |
|---|---|
| id | The property that shall be matched against the restriction. Type: ToiContentService.ToiPropertyId |
| restrictions | The restriction definitions. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiContentService.ToiRestriction> (Or a single ToiContentService.ToiRestriction.) |
Structure containing content information.
Struct fields
| Name | Description |
|---|---|
| id | The unique content identifier. Type: ToiContentService.ToiContentId |
| properties | The content metadata properties. Type: ToiContentService.ToiPropertyMap |
| sourceId | The unique identifier of the source where the content is located. Type: ToiContentService.ToiSourceId |
Specifies which content to get information about, and which additional properties that should be included in the result when performing a get content operation.
Struct fields
| Name | Description |
|---|---|
| contentIds | Content identifiers to request information for. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiContentService.ToiContentId> (Or a single ToiContentService.ToiContentId.) |
| requestedProperties
[optional] |
Properties to be included in the content result. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiContentService.ToiPropertyId> (Or a single ToiContentService.ToiPropertyId.) |
Structure that represents a property identifier, value pair.
Struct fields
| Name | Description |
|---|---|
| id | The property identifier. Type: ToiContentService.ToiPropertyId |
| value | The value this property has. Type: string |
Known query capabilities for a content source.
Struct fields
| Name | Description |
|---|---|
| isSortSupported | If sorting of results is supported by the source. Type: boolean |
| supportedContentProperties | The content property identifiers supported by the source. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiContentService.ToiPropertyId> (Or a single ToiContentService.ToiPropertyId.) |
| supportedSourceProperties | The source property identifiers supported by the source. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiContentService.ToiPropertyId> (Or a single ToiContentService.ToiPropertyId.) |
Defines a restriction for a property.
Struct fields
| Name | Description |
|---|---|
| equals
[optional] |
This sets a specific value restriction for a property. The value need to be stringified if the intended property is of another type than ToiContentService.PROPERTY_TYPE_STRING. Type: string |
| exists
[optional] |
This sets a restriction on property existence. Type: boolean |
| invert
[optional] |
Setting this to 'true' inverts the restrictions. Type: boolean |
| like
[optional] |
This sets a fuzzy "well enough matching" string restriction for a property. Type: string |
| max
[optional] |
This sets a max value restriction for a property. The property will be interpreted as an integer type. Type: number |
| min
[optional] |
This sets a min value restriction for a property. The property will be interpreted as an integer type. Type: number |
Defines a structure with all the needed information to perform a search.
Struct fields
| Name | Description |
|---|---|
| contentConditions
[optional] |
Conditions on content properties which all needs to be fulfilled to result in a content match. Type: ToiContentService.ToiConditionMap |
| requestedProperties
[optional] |
The properties to include for any matching content. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiContentService.ToiPropertyId> (Or a single ToiContentService.ToiPropertyId.) |
| sortRules
[optional] |
The sort rules that shall be applied to the source result. The sorting is only applied if the sort rules are supported by the source. Please note that the sorting does not operate on the aggregated result from all sources. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiContentService.ToiSortRule> (Or a single ToiContentService.ToiSortRule.) |
| sourceConditions
[optional] |
Conditions on source properties which all needs to be fulfilled by the source or the result set of the source. Type: ToiContentService.ToiConditionMap |
| sources
[optional] |
The sources to search in. If not present, the search will be done in all available sources. Note that TOI always provides an Array, even if there is only a single value. Type: Array.<ToiContentService.ToiSourceId> (Or a single ToiContentService.ToiSourceId.) |
Definition of a sort rule which can be used for sorting search results if supported by the content source.
Struct fields
| Name | Description |
|---|---|
| id | Property identifier to sort on. Type: ToiContentService.ToiPropertyId |
| sortAscending
[optional] |
Ascending/descending sort order. Handled as true if not set. Type: boolean |
| type
[optional] |
Which type the property shall be treated as. If not set, it will be treated as a string. Type: ToiContentService.ToiPropertyType |
Information about a content source.
Struct fields
| Name | Description |
|---|---|
| id | The unique source identifier. Type: ToiContentService.ToiSourceId |
| isLocal | True if the source is local to the STB (i.e. local filesystem). Type: boolean |
| isNotificationSupported | True if new/changed/removed content is notified by the source. Type: boolean |
| isPropertyModificationSupported | True if the source supports modifying content properties. Type: boolean |
| isRemovalSupported | True if the source supports content removal. Type: boolean |
| queryCapabilities | The query capabilities of the source. Type: ToiContentService.ToiQueryCapabilities |
| secondaryApplication
[optional] |
If set, the name of the secondary application associated with this source. Type: string |
| type | The source type. Type: ToiContentService.ToiSourceType |