mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-06 04:20:46 +00:00
9.6 KiB
9.6 KiB
Video
(video)
Overview
API Calls that perform operations with Plex Media Server Videos
Available Operations
- getTimeline - Get the timeline for a media item
- startUniversalTranscode - Start Universal Transcode
getTimeline
Get the timeline for a media item
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
import { State } from "@lukehagar/plexjs/models/operations";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const result = await plexAPI.video.getTimeline({
ratingKey: 716.56,
key: "<key>",
state: State.Paused,
hasMDE: 7574.33,
time: 3327.51,
duration: 7585.39,
context: "<value>",
playQueueItemID: 1406.21,
playBackTime: 2699.34,
row: 3536.42,
});
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetTimelineRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
Response
Promise<operations.GetTimelineResponse>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.GetTimelineResponseBody | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |
startUniversalTranscode
Begin a Universal Transcode Session
Example Usage
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const result = await plexAPI.video.startUniversalTranscode({
hasMDE: 8924.99,
path: "/etc/mail",
mediaIndex: 9962.95,
partIndex: 1232.82,
protocol: "<value>",
});
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.StartUniversalTranscodeRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
Response
Promise<operations.StartUniversalTranscodeResponse>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.StartUniversalTranscodeResponseBody | 401 | application/json |
| errors.SDKError | 4xx-5xx | / |