Show:

Contains all Requests connected with assets/items

Methods

checkAccessForAsset
(
  • id
)
Object
async

Checks whether a given authenticated user has access for an asset

Parameters:

  • id Number
    • The id of the asset

Returns:

Object

Example:

InPlayer.Asset.checkAccessForAsset(42597)
.then(data => console.log(data));
getAccessCode
(
  • data
)
Object | null

Retrieves the access code and browser fingerprint for the current asset. Returns null if no access code is present.

Parameters:

  • data Object

    = { assetId: {number}, code: {string} }

Returns:

Object | null

Example:

const accessCode = InPlayer.Asset.getAccessCode();

getAsset
(
  • assetId
  • merchantUuid
)
Object
async

Get the asset info for a given asset ID and merchant UUID

Parameters:

  • assetId Number
    • The ID of the asset
  • merchantUuid String
    • The merchant UUID string

Returns:

Object

Example:

InPlayer.Asset
.getAsset(2,'a1f13-dd1dfh-rfh123-dhd1hd-fahh1dl')
.then(data => console.log(data));
getAssetAccessFees
(
  • id
)
Object
async

Get the access fees for a given asset ID

Parameters:

  • id Number
    • The ID of the asset

Returns:

Object

Example:

InPlayer.Asset
.getAssetAccessFees(555)
.then(data => console.log(data))
getAssetsHistory
(
  • size
  • page
  • startDate
  • endDate
)
Array
async

Returns purchase history with types

Parameters:

  • size Number
    • The page size
  • page Number
    • The current page / starting index = 0
  • startDate String
    • Staring date filter
  • endDate String
    • Ending date filter

Returns:

Array

Example:

InPlayer.Asset
.getAssetsHistory()
.then(data => console.log(data))
getCloudfrontURL
(
  • assetId
  • videoUrl
)
Object
async

Returns a signed Cloudfront URL with the merchant's signature

Parameters:

  • assetId Number
  • videoUrl String

Returns:

Object:

data = { video_url: {string} }

Example:

InPlayer.Asset
.getCloudfrontURL(42599, 'url')
.then(data => console.log(data));
getExternalAsset
(
  • assetType
  • externalId
  • merchantUuid
)
Object
async

Get an external assets info

Parameters:

  • assetType String
    • The type ID of the asset
  • externalId String
    • The ID of the external asset
  • merchantUuid String
    • OPTIONAL - the merchant uuid

Returns:

Object

Example:

InPlayer.Asset
.getExternalAsset('ooyala','44237')
.then(data => console.log(data));
getFreemiumAsset
(
  • accessFee
)
Object
async

Authorize for the freemium asset (login)

Parameters:

  • accessFee Object

Returns:

Object

Example:

InPlayer.Asset
.getFreemiumAsset(2233)
.then(data => console.log(data));
getPackage
(
  • id
)
Object
async

Get package info for a given Package ID

Parameters:

  • id Number
    • The type ID of the package

Returns:

Object

Example:

InPlayer.Asset
.getPackage(4444)
.then(data => console.log(data));
isFreeTrialUsed
(
  • id
)
Object
async

Checks whether Free trial has been used for a given asset

Parameters:

  • id Number
    • The ID of the asset

Returns:

Object

Example:

InPlayer.Asset
.isFreeTrialUsed(36320)
.then(data => console.log(data));
releaseAccessCode
(
  • -
)
Object
async

Releases the access code for the current browser.

Parameters:

  • - Number

    assetId

Returns:

Object

Example:

InPlayer.Asset
.releaseAccessCode(42599)
.then(data => console.log(data));
requestCodeAccess
(
  • data
)
Object
async

Get access with code for code access grant asset.

Parameters:

  • data Object

    = { assetId: {number}, code: {string} }

Returns:

Object

Example:

InPlayer.Asset
.requestCodeAccess({ assetId: 42599, code: 'access-code' })
.then(data => console.log(data));