Asset
Contains all Requests connected with assets/items
Table of Contents
-
Methods
- checkAccessForAsset(id)
- getAccessCode(data)
- getAsset(assetIdmerchantUuid)
- getAssetAccessFees(id)
- getAssetsHistory(sizepagestartDateendDate)
- getCloudfrontURL(assetIdvideoUrl)
- getExternalAsset(assetTypeexternalIdmerchantUuid)
- getFreemiumAsset(accessFee)
- getPackage(id)
- isFreeTrialUsed(id)
- releaseAccessCode(-)
- requestCodeAccess(data)
Methods
checkAccessForAsset
-
id
Checks whether a given authenticated user has access for an asset
Parameters:
-
id
Number- The id of the asset
Returns:
Example:
InPlayer.Asset.checkAccessForAsset(42597)
.then(data => console.log(data));
getAccessCode
-
data
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:
Example:
const accessCode = InPlayer.Asset.getAccessCode();
getAsset
-
assetId
-
merchantUuid
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:
Example:
InPlayer.Asset
.getAsset(2,'a1f13-dd1dfh-rfh123-dhd1hd-fahh1dl')
.then(data => console.log(data));
getAssetAccessFees
-
id
Get the access fees for a given asset ID
Parameters:
-
id
Number- The ID of the asset
Returns:
Example:
InPlayer.Asset
.getAssetAccessFees(555)
.then(data => console.log(data))
getAssetsHistory
-
size
-
page
-
startDate
-
endDate
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:
Example:
InPlayer.Asset
.getAssetsHistory()
.then(data => console.log(data))
getCloudfrontURL
-
assetId
-
videoUrl
Returns a signed Cloudfront URL with the merchant's signature
Parameters:
-
assetId
Number -
videoUrl
String
Returns:
data = { video_url: {string} }
Example:
InPlayer.Asset
.getCloudfrontURL(42599, 'url')
.then(data => console.log(data));
getExternalAsset
-
assetType
-
externalId
-
merchantUuid
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:
Example:
InPlayer.Asset
.getExternalAsset('ooyala','44237')
.then(data => console.log(data));
getFreemiumAsset
-
accessFee
Authorize for the freemium asset (login)
Parameters:
-
accessFee
Object
Returns:
Example:
InPlayer.Asset
.getFreemiumAsset(2233)
.then(data => console.log(data));
getPackage
-
id
Get package info for a given Package ID
Parameters:
-
id
Number- The type ID of the package
Returns:
Example:
InPlayer.Asset
.getPackage(4444)
.then(data => console.log(data));
isFreeTrialUsed
-
id
Checks whether Free trial has been used for a given asset
Parameters:
-
id
Number- The ID of the asset
Returns:
Example:
InPlayer.Asset
.isFreeTrialUsed(36320)
.then(data => console.log(data));
releaseAccessCode
-
-
Releases the access code for the current browser.
Parameters:
-
-
NumberassetId
Returns:
Example:
InPlayer.Asset
.releaseAccessCode(42599)
.then(data => console.log(data));
requestCodeAccess
-
data
Get access with code for code access grant asset.
Parameters:
-
data
Object= { assetId: {number}, code: {string} }
Returns:
Example:
InPlayer.Asset
.requestCodeAccess({ assetId: 42599, code: 'access-code' })
.then(data => console.log(data));