mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
6.1 KiB
6.1 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
package main
import(
"github.com/LukeHagar/plexgo/models/components"
"github.com/LukeHagar/plexgo"
"context"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("Postman"),
)
ctx := context.Background()
res, err := s.Video.GetTimeline(ctx, operations.GetTimelineRequest{
RatingKey: 716.56,
Key: "<key>",
State: operations.StatePaused,
HasMDE: 7574.33,
Time: 3327.51,
Duration: 7585.39,
Context: "<value>",
PlayQueueItemID: 1406.21,
PlayBackTime: 2699.34,
Row: 3536.42,
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetTimelineRequest | ✔️ | The request object to use for the request. |
Response
*operations.GetTimelineResponse, error
| Error Object | Status Code | Content Type |
|---|---|---|
| sdkerrors.GetTimelineResponseBody | 401 | application/json |
| sdkerrors.SDKError | 4xx-5xx | / |
StartUniversalTranscode
Begin a Universal Transcode Session
Example Usage
package main
import(
"github.com/LukeHagar/plexgo/models/components"
"github.com/LukeHagar/plexgo"
"context"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
plexgo.WithXPlexClientIdentifier("Postman"),
)
ctx := context.Background()
res, err := s.Video.StartUniversalTranscode(ctx, operations.StartUniversalTranscodeRequest{
HasMDE: 8924.99,
Path: "/etc/mail",
MediaIndex: 9962.95,
PartIndex: 1232.82,
Protocol: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.StartUniversalTranscodeRequest | ✔️ | The request object to use for the request. |
Response
*operations.StartUniversalTranscodeResponse, error
| Error Object | Status Code | Content Type |
|---|---|---|
| sdkerrors.StartUniversalTranscodeResponseBody | 401 | application/json |
| sdkerrors.SDKError | 4xx-5xx | / |