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:
-
idNumber- 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:
-
dataObject= { 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:
-
assetIdNumber- The ID of the asset
-
merchantUuidString- 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:
-
idNumber- 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:
-
sizeNumber- The page size
-
pageNumber- The current page / starting index = 0
-
startDateString- Staring date filter
-
endDateString- 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:
-
assetIdNumber -
videoUrlString
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:
-
assetTypeString- The type ID of the asset
-
externalIdString- The ID of the external asset
-
merchantUuidString- 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:
-
accessFeeObject
Returns:
Example:
InPlayer.Asset
.getFreemiumAsset(2233)
.then(data => console.log(data));
getPackage
-
id
Get package info for a given Package ID
Parameters:
-
idNumber- 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:
-
idNumber- 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:
-
dataObject= { assetId: {number}, code: {string} }
Returns:
Example:
InPlayer.Asset
.requestCodeAccess({ assetId: 42599, code: 'access-code' })
.then(data => console.log(data));