Contents
On this page

Get Watch Progress - Plugixa Video

GET /pvx/v1/videos/{id}/progress

Read where the caller stopped in a video.

Any signed-in user (signed in with an Application Password or the login cookie). Signed out, it answers 401. The caller must be allowed to watch the video. Part of the core Playback app, so it works with the Viewer library app off.

Request

GET https://your-site.example/wp-json/pvx/v1/videos/838/progress

Path parameters

Name Type Description
id integer The video’s id

Responses

200 OK. data is the saved progress, or null when the caller never played the video.

{
  "success": true,
  "data": {
    "position": 412,
    "duration": 1460,
    "completed": false
  }
}
Field Type Meaning
data.position integer Seconds from the start
data.duration integer Seconds, as reported by the player
data.completed boolean Reached 95% of the length at least once

Errors

Status Code When
401 plugixa_video_login_required Signed out.
403 plugixa_video_forbidden The caller may not watch this video, it has a password, or there is no video with that id.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/pvx/v1/videos/838/progress" \
  -u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/pvx/v1/videos/838/progress');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/pvx/v1/videos/838/progress', {
  headers: {
    'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
  },
});
const { data } = await response.json();

Quick Links

Share