AbstractVodService

AbstractVodService ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Mixes: MServiceCache
Service:

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

ParamTypeDefaultDescription
[options]Object

some options

[options.type]boolean$CatalogTypes.VOD

filter catalog by type

[options.force]booleanfalse

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

ParamTypeDefaultDescription
[options]Object

some options

[options.type]boolean$CatalogTypes.VOD

filter catalog by type

[options.force]booleanfalse

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

ParamTypeDefaultDescription
catalogIdstring

Catalog id

[options]Object

some options

[options.force]booleanfalse

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

ParamTypeDefaultDescription
catalogIdstring

Catalog id

categoryIdstring

Category id

[options]Object

some options

[options.force]booleanfalse

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

ParamTypeDefaultDescription
idstring | Array.<string>

The id or a list of id used by filter

optionsObject

some options

[options.filter]ContentFilterContentFilter.BY_CATEGORY

Have a look at constants within ContentFilter

[options.force]booleanfalse

If true, don't use the cache

[options.start]number0

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

ParamTypeDefaultDescription
contentIdstring

Id of a content

[options]Object

some options

[options.force]booleanfalse

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

ParamTypeDefaultDescription
contentIdstring

Id of a content

[options]Object

some options

[options.force]booleanfalse

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

ParamTypeDefaultDescription
peopleIdstring

Id of people

[options]Object

some options

[options.force]booleanfalse

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

ParamTypeDescription
paramsObject
params.searchValueString

text to search

_getCatalogsId([options]) ⇒ Promise

Vendor implementation to get available catalogs id.

Kind: instance abstract method of AbstractVodService
Access: protected

ParamTypeDefaultDescription
[options]Object

some options

[options.force]booleanfalse

If true, don't use the cache

_getCatalogs([options]) ⇒ Promise

Vendor implementation to get available catalogs

Kind: instance abstract method of AbstractVodService
Access: protected

ParamTypeDefaultDescription
[options]Object

some options

[options.force]booleanfalse

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

ParamTypeDefaultDescription
catalogIdstring

Catalog id

[options]Object

some options

[options.force]booleanfalse

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

ParamTypeDefaultDescription
catalogIdstring

Catalog id

categoryIdstring

Category id

[options]Object

some options

[options.force]booleanfalse

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

ParamTypeDefaultDescription
idstring | Array.<string>

The id or a list of id used by filter

optionsObject

some options

[options.filter]ContentFilterContentFilter.BY_CATEGORY

Have a look at constants within ContentFilter

[options.force]booleanfalse

If true, don't use the cache

[options.start]number0

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

ParamTypeDefaultDescription
contentIdstring

Id of a content

[options]Object

some options

[options.force]booleanfalse

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

ParamTypeDefaultDescription
contentIdstring

Id of a content

[options]Object

some options

[options.force]booleanfalse

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

ParamTypeDefaultDescription
peopleIdstring

Id of people

[options]Object

some options

[options.force]booleanfalse

If true, don't use the cache