AbstractVodService
On this page
- AbstractVodService ⇐
Abstract- AbstractVodService()
- getCatalogsId([options]) ⇒
Promise.<string, Error> - getCatalogs([options]) ⇒
Promise.<CatalogList, Error> - getCatalog(catalogId, [options]) ⇒
Promise.<Catalog, Error> - getCategory(catalogId, categoryId, [options]) ⇒
Promise.<Category, Error> - getContents(id, options) ⇒
Promise.<ContentList, Error> - getContentDetails(contentId, [options]) ⇒
Promise.<Content, Error> - getContentMedia(contentId, [options]) ⇒
Promise.<AbstractMedia, Error> - getPeopleDetails(peopleId, [options]) ⇒
Promise.<People, Error> - search(params) ⇒
Promise.<Array.<AbstractMedia>, Error> - _getCatalogsId([options]) ⇒
Promise - _getCatalogs([options]) ⇒
Promise - _getCatalog(catalogId, [options]) ⇒
Promise - _getCategory(catalogId, categoryId, [options]) ⇒
Promise - _getContents(id, options) ⇒
Promise.<Content, Error> - _getContentDetails(contentId, [options]) ⇒
Promise - _getContentMedia(contentId, [options]) ⇒
Promise - _getPeopleDetails(peopleId, [options]) ⇒
Promise
AbstractVodService ⇐ Abstract
Kind: global abstract class
Extends: Abstract
Mixes: MServiceCache
Service:
- AbstractVodService ⇐
Abstract- new AbstractVodService()
- .getCatalogsId([options]) ⇒
Promise.<string, Error> - .getCatalogs([options]) ⇒
Promise.<CatalogList, Error> - .getCatalog(catalogId, [options]) ⇒
Promise.<Catalog, Error> - .getCategory(catalogId, categoryId, [options]) ⇒
Promise.<Category, Error> - .getContents(id, options) ⇒
Promise.<ContentList, Error> - .getContentDetails(contentId, [options]) ⇒
Promise.<Content, Error> - .getContentMedia(contentId, [options]) ⇒
Promise.<AbstractMedia, Error> - .getPeopleDetails(peopleId, [options]) ⇒
Promise.<People, Error> - .search(params) ⇒
Promise.<Array.<AbstractMedia>, Error> - ._getCatalogsId([options]) ⇒
Promise - ._getCatalogs([options]) ⇒
Promise - ._getCatalog(catalogId, [options]) ⇒
Promise - ._getCategory(catalogId, categoryId, [options]) ⇒
Promise - ._getContents(id, options) ⇒
Promise.<Content, Error> - ._getContentDetails(contentId, [options]) ⇒
Promise - ._getContentMedia(contentId, [options]) ⇒
Promise - ._getPeopleDetails(peopleId, [options]) ⇒
Promise
AbstractVodService()
The VodService exposes the VOD API.
Example
vodService
.getCatalogsId()
.then(catalogs => catalogs[0])
.then(catalogId => vodService.getCatalog(catalogId))
.then(catalog => vodService.getContents(catalog.children[0].id))
.then(contents => {
console.log(contents);
})getCatalogsId([options]) ⇒ Promise.<string, Error>
Get all catalogs id
Kind: instance method of AbstractVodService
Returns: Promise.<string, Error> - list of catalog’s id
| Param | Type | Default | Description |
|---|---|---|---|
| [options] | Object | some options | |
| [options.type] | boolean | $CatalogTypes.VOD | filter catalog by type |
| [options.force] | boolean | false | If true, don't use the cache |
| [options.duration] | number | | Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
getCatalogs([options]) ⇒ Promise.<CatalogList, Error>
Get all catalogs
Kind: instance method of AbstractVodService
Returns: Promise.<CatalogList, Error> - list of catalog’s id
| Param | Type | Default | Description |
|---|---|---|---|
| [options] | Object | some options | |
| [options.type] | boolean | $CatalogTypes.VOD | filter catalog by type |
| [options.force] | boolean | false | If true, don't use the cache |
| [options.duration] | number | | Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
getCatalog(catalogId, [options]) ⇒ Promise.<Catalog, Error>
Retrieve available catalog by it’s id.
Kind: instance method of AbstractVodService
Returns: Promise.<Catalog, Error> - a catalog
| Param | Type | Default | Description |
|---|---|---|---|
| catalogId | string | Catalog id | |
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
| [options.duration] | number | | Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
getCategory(catalogId, categoryId, [options]) ⇒ Promise.<Category, Error>
Retrieve a category information by it’s id.
Kind: instance method of AbstractVodService
Returns: Promise.<Category, Error> - a category
| Param | Type | Default | Description |
|---|---|---|---|
| catalogId | string | Catalog id | |
| categoryId | string | Category id | |
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
| [options.duration] | number | | Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
getContents(id, options) ⇒ Promise.<ContentList, Error>
Retrieves contents of the given filter
Kind: instance method of AbstractVodService
Returns: Promise.<ContentList, Error> - list of content
| Param | Type | Default | Description |
|---|---|---|---|
| id | string | Array.<string> | The id or a list of id used by filter | |
| options | Object | some options | |
| [options.filter] | ContentFilter | ContentFilter.BY_CATEGORY | Have a look at constants within ContentFilter |
| [options.force] | boolean | false | If true, don't use the cache |
| [options.start] | number | 0 | index of the first media to retrieve |
| [options.number] | number | number of contents to retrieve. If not set, the method returns all contents | |
| [options.duration] | number | | Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
getContentDetails(contentId, [options]) ⇒ Promise.<Content, Error>
Retrieve content details by it’s id and type (MOVIE|SERIES|SEASON|EPISODE)
Kind: instance method of AbstractVodService
Returns: Promise.<Content, Error> - Content details
| Param | Type | Default | Description |
|---|---|---|---|
| contentId | string | Id of a content | |
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
| [options.duration] | number | | Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
getContentMedia(contentId, [options]) ⇒ Promise.<AbstractMedia, Error>
Retrieve content medias by it’s id
Kind: instance method of AbstractVodService
Returns: Promise.<AbstractMedia, Error> - A Promise resolved with a list of AbstractMedia
| Param | Type | Default | Description |
|---|---|---|---|
| contentId | string | Id of a content | |
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
| [options.type] | boolean | The type of the media | |
| [options.duration] | number | | Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
getPeopleDetails(peopleId, [options]) ⇒ Promise.<People, Error>
Retrieve people and it’s content by id.
Kind: instance method of AbstractVodService
Returns: Promise.<People, Error> - People details
| Param | Type | Default | Description |
|---|---|---|---|
| peopleId | string | Id of people | |
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
| [options.duration] | number | | Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default) |
search(params) ⇒ Promise.<Array.<AbstractMedia>, Error>
Search medias.
Kind: instance method of AbstractVodService
Returns: Promise.<Array.<AbstractMedia>, Error> - A Promise resolved with an array of AbstractMedia
| Param | Type | Description |
|---|---|---|
| params | Object | |
| params.searchValue | String | text to search |
_getCatalogsId([options]) ⇒ Promise
Vendor implementation to get available catalogs id.
Kind: instance abstract method of AbstractVodService
Access: protected
| Param | Type | Default | Description |
|---|---|---|---|
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
_getCatalogs([options]) ⇒ Promise
Vendor implementation to get available catalogs
Kind: instance abstract method of AbstractVodService
Access: protected
| Param | Type | Default | Description |
|---|---|---|---|
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
_getCatalog(catalogId, [options]) ⇒ Promise
Vendor implementation to get available catalogs.
Kind: instance abstract method of AbstractVodService
Access: protected
| Param | Type | Default | Description |
|---|---|---|---|
| catalogId | string | Catalog id | |
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
_getCategory(catalogId, categoryId, [options]) ⇒ Promise
Vendor implementation to get a category.
Kind: instance abstract method of AbstractVodService
Access: protected
| Param | Type | Default | Description |
|---|---|---|---|
| catalogId | string | Catalog id | |
| categoryId | string | Category id | |
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
_getContents(id, options) ⇒ Promise.<Content, Error>
Vendor implementation to get contents of the given category
Kind: instance abstract method of AbstractVodService
Returns: Promise.<Content, Error> - list of content
Access: protected
| Param | Type | Default | Description |
|---|---|---|---|
| id | string | Array.<string> | The id or a list of id used by filter | |
| options | Object | some options | |
| [options.filter] | ContentFilter | ContentFilter.BY_CATEGORY | Have a look at constants within ContentFilter |
| [options.force] | boolean | false | If true, don't use the cache |
| [options.start] | number | 0 | index of the first media to retrieve |
| [options.number] | number | number of contents to retrieve. If not set, the method returns all contents |
_getContentDetails(contentId, [options]) ⇒ Promise
Vendor implementation to get content details
Kind: instance abstract method of AbstractVodService
Access: protected
| Param | Type | Default | Description |
|---|---|---|---|
| contentId | string | Id of a content | |
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
_getContentMedia(contentId, [options]) ⇒ Promise
Vendor implementation to get content media
Kind: instance abstract method of AbstractVodService
Access: protected
| Param | Type | Default | Description |
|---|---|---|---|
| contentId | string | Id of a content | |
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |
_getPeopleDetails(peopleId, [options]) ⇒ Promise
Vendor implementation to get people details
Kind: instance abstract method of AbstractVodService
Access: protected
| Param | Type | Default | Description |
|---|---|---|---|
| peopleId | string | Id of people | |
| [options] | Object | some options | |
| [options.force] | boolean | false | If true, don't use the cache |