Files
plexgo/docs/sdks/video/README.md

130 lines
6.1 KiB
Markdown

# Video
(*Video*)
## Overview
API Calls that perform operations with Plex Media Server Videos
### Available Operations
* [GetTimeline](#gettimeline) - Get the timeline for a media item
* [StartUniversalTranscode](#startuniversaltranscode) - Start Universal Transcode
## GetTimeline
Get the timeline for a media item
### Example Usage
```go
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](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
| `request` | [operations.GetTimelineRequest](../../models/operations/gettimelinerequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[*operations.GetTimelineResponse](../../models/operations/gettimelineresponse.md), error**
| Error Object | Status Code | Content Type |
| --------------------------------- | --------------------------------- | --------------------------------- |
| sdkerrors.GetTimelineResponseBody | 401 | application/json |
| sdkerrors.SDKError | 4xx-5xx | */* |
## StartUniversalTranscode
Begin a Universal Transcode Session
### Example Usage
```go
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](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. |
| `request` | [operations.StartUniversalTranscodeRequest](../../models/operations/startuniversaltranscoderequest.md) | :heavy_check_mark: | The request object to use for the request. |
### Response
**[*operations.StartUniversalTranscodeResponse](../../models/operations/startuniversaltranscoderesponse.md), error**
| Error Object | Status Code | Content Type |
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
| sdkerrors.StartUniversalTranscodeResponseBody | 401 | application/json |
| sdkerrors.SDKError | 4xx-5xx | */* |