Cross-Device Resume: Playback Position

This request is only one part of implementing cross-device resume (XDR).

A full discussion is in the Player V3 for Cross-Device Resume (XDR).

There are two ways to get a playback position:
  • For a specific asset for a given user
  • For all assets of a given user

Ooyala stores the playhead positions only as far back as 90 days.

Note:

User account ids are distinct per provider. Two different providers can have a user with the same name, but these are treated as distinct users. The account_id you use with Ooyala APIs must be unique in your own systems. For privacy, Ooyala encourages that the value of account_id be some sort of GUID (global unique identifier), rather than a plain-text username or email address. For example, an acceptable account_id is to use a base64, URl-encoded, Secure-hash-algorithm-(SHA)-256 digest of the username or email address, salted with some secret string that only you know. This salt must not be reused for any of your vendors other than Ooyala. This ensures that neither Ooyala nor a "man-in-the-middle" hacker sniffing network traffic can translate back from your GUIDs to real usernames or passwords. The account_id must be less than 255 characters and must not contain reserved URL characters such as [/, &, |, or ]. In most cases, you do not need to explicitly create an account with Ooyala APIs; you simply refer to an account wherever an API request requires it.

Playback Position for a Single Asset For a Given Account

To get the playback position for a specific asset for a given user:

[GET]/v2/cross_device_resume/accounts/account_id/viewed_assets/embed_code/playhead_info

Response:

{  
   "playhead_seconds":200.0,
   "timestamp":1369438194
}

Playback Position for All Assets For a Given Account

To get the playback positions for all assets viewed for a specific user. Items are grouped by asset ID (embed_code). The response includes the account ID and the provider ID.

[GET]/v2/cross_device_resume/accounts/account_id/playhead_info?limit=max_number_results&start_date=yyyy-mm-dd

Example Response

{  
   "items":[  
      {  
         "playhead_seconds":200.0,
         "timestamp":1369438194,
         "embed_code":"g1cTd3NDpdGQC6iaqlLnP7Fb"
      },
      {  
         "playhead_seconds":100.0,
         "timestamp":1369438193,
         "embed_code":"gzcTd3ND3W-K2sSjxS1Joehi9"
      }
   ],
   "account":"097325097354-9y3-8y7",
   "provider_id":"x4Z3g6cupBeswLiTso3nxE-BqW"
}

Route Attributes

The following table describes all attributes that can be expressed through the route.

Route Attribute Description
account_id

The identifier of the user account.

Type: String

Default: None

Query String Parameters

The following table describes all parameters that can be used on the query string.

Parameter Description Required?
limit

The maximum number of results to return.

Type: Integer

Example: ?limit=5

No
start_date

Starting date for search, in the format YYYY-MM-DD

Type: String

Example: ?start_date=2013-09-11

No

Properties

The following table describes all properties that can be returned in the response3.

Property Description
account The account ID you passed on the request.

Type: String

playhead_seconds
The position expressed in seconds of the last playhead update received by Ooyala.
Note: This is not necessarily the same as the farthest position the viewer may have reached.

Type: Float

Example: "201.0"

provider_id The identifier of the provider (owner of the asset).

Type: String

Example: x4Z3g6cupBeswLiTso3nxE-BqW

timestamp

Epoch time (seconds since January 1, 1970) of the most recent playhead update for the asset.

Type: String

Example: "1369438193"

Was this article helpful?