(playback)
Operations related to playback api
- get - Retrieve Playback Info
Retrieve Playback Info
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.playback.get("<id>");
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { LivepeerCore } from "livepeer/core.js";
import { playbackGet } from "livepeer/funcs/playbackGet.js";
// Use `LivepeerCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const livepeer = new LivepeerCore({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await playbackGet(livepeer, "<id>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | The playback ID from the asset or livestream, e.g. eaw4nk06ts2d0mzb . |
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. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetPlaybackInfoResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorT | 404 | application/json |
errors.SDKError | 4XX, 5XX | */* |