Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Asset

Contains all Requests connected with assets/items

Hierarchy

Index

Constructors

constructor

  • Parameters

    Returns Asset

Properties

config

config: ApiConfig

item_id

item_id: number

request

request: Request

setConfig

setConfig: (env: Env) => void

Type declaration

    • (env: Env): void
    • Parameters

      Returns void

total

total: number

values

values: AssetValue[]

Methods

checkAccessForAsset

  • Checks whether a given authenticated user has access for an asset

    method

    checkAccessForAsset

    async
    example
    InPlayer.Asset.checkAccessForAsset(42597)
    .then(data => console.log(data));

    Parameters

    • id: number

      The id of the asset

    Returns Promise<AxiosResponse<GetItemAccessV1>>

getAccesCodeSessions

  • Parameters

    • code: string

    Returns Promise<AxiosResponse<Array<CodeAccessSessionsData>>>

getAccessCode

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

    method

    getAccessCode

    example

    const accessCode = InPlayer.Asset.getAccessCode();

    Parameters

    • assetId: number

    Returns CodeAccessData | null

getAsset

  • getAsset(assetId: number, merchantUuid: string): Promise<AxiosResponse<ItemDetailsV1>>
  • Get the asset info for a given asset ID and merchant UUID

    method

    getAsset

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

    Parameters

    • assetId: number

      The ID of the asset

    • merchantUuid: string

      The merchant UUID string

    Returns Promise<AxiosResponse<ItemDetailsV1>>

getAssetAccessFees

  • getAssetAccessFees(id: number): Promise<AxiosResponse<GetAccessFee>>
  • Get the access fees for a given asset ID

    method

    getAssetAccessFees

    async
    example
    InPlayer.Asset
    .getAssetAccessFees(555)
    .then(data => console.log(data))

    Parameters

    • id: number

      The ID of the asset

    Returns Promise<AxiosResponse<GetAccessFee>>

getAssetsHistory

  • getAssetsHistory(size?: undefined | number, page?: undefined | number, startDate?: undefined | string, endDate?: undefined | string): Promise<AxiosResponse<Record<string, unknown>[]>>
  • Returns purchase history with types

    method

    getAssetsHistory

    async
    example
    InPlayer.Asset
    .getAssetsHistory()
    .then(data => console.log(data))

    Parameters

    • Optional size: undefined | number

      The page size

    • Optional page: undefined | number

      The current page / starting index = 0

    • Optional startDate: undefined | string

      Staring date filter

    • Optional endDate: undefined | string

      Ending date filter

    Returns Promise<AxiosResponse<Record<string, unknown>[]>>

getCloudfrontURL

  • getCloudfrontURL(assetId: number, videoUrl: string): Promise<AxiosResponse<CloudfrontUrl>>
  • Returns a signed Cloudfront URL with the merchant's signature

    method

    getCloudfrontURL

    async
    example
    InPlayer.Asset
    .getCloudfrontURL(42599, 'url')
    .then(data => console.log(data));

    Parameters

    • assetId: number
    • videoUrl: string

    Returns Promise<AxiosResponse<CloudfrontUrl>>

    s {Object} data = { video_url: {string} }

getExternalAsset

  • getExternalAsset(assetType: string, externalId: string, merchantUuid: string): Promise<AxiosResponse<ExternalItemDetails>>
  • Get an external assets info

    method

    getExternalAsset

    async
    example
    InPlayer.Asset
    .getExternalAsset('ooyala','44237')
    .then(data => console.log(data));

    Parameters

    • assetType: string

      The type ID of the asset

    • externalId: string

      The ID of the external asset

    • merchantUuid: string

      OPTIONAL - the merchant uuid

    Returns Promise<AxiosResponse<ExternalItemDetails>>

getPackage

  • Get package info for a given Package ID

    method

    getPackage

    async
    example
    InPlayer.Asset
    .getPackage(4444)
    .then(data => console.log(data));

    Parameters

    • id: number

      The type ID of the package

    Returns Promise<AxiosResponse<GetMerchantPackage>>

isFreeTrialUsed

  • isFreeTrialUsed(id: number): Promise<AxiosResponse<any>>
  • Checks whether Free trial has been used for a given asset

    method

    isFreeTrialUsed

    async
    example
    InPlayer.Asset
    .isFreeTrialUsed(36320)
    .then(data => console.log(data));

    Parameters

    • id: number

      The ID of the asset

    Returns Promise<AxiosResponse<any>>

releaseAccessCode

  • releaseAccessCode(assetId: number): Promise<AxiosResponse<CodeAccessData> | null>
  • Releases the access code for the current browser.

    method

    releaseAccessCode

    async
    throws

    Will throw an HTTP 400 error if the code is not in use.

    example
    InPlayer.Asset
    .releaseAccessCode(42599)
    .then(data => console.log(data));

    Parameters

    • assetId: number

    Returns Promise<AxiosResponse<CodeAccessData> | null>

requestCodeAccess

  • Get access with code for code access grant asset.

    method

    requestCodeAccess

    async
    throws

    Will throw an HTTP 400 error if the access code is already in use.

    throws

    Will throw an HTTP 401 error if the code is invalid.

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

    Parameters

    Returns Promise<AxiosResponse<CodeAccessData>>

requestDataCaptureNoAuthAccess

  • Get access without authentication for asset with access control type data capture

    method

    requestDataCaptureNoAuthAccess

    async

    Parameters

    Returns Promise<any>

terminateSession

  • terminateSession(assetId: number): Promise<AxiosResponse<null>>
  • Terminates session for the current browser.

    method

    terminateSession

    async
    example
    InPlayer.Asset
    .terminateSession(42599)
    .then(data => console.log(data));

    Parameters

    • assetId: number

    Returns Promise<AxiosResponse<null>>

    null

Generated using TypeDoc