Generates a new playback ID for the live stream, allowing viewers to access the stream through this ID. The playback ID can be shared with viewers for direct access to the live broadcast.
By calling this endpoint with the streamId, FastPix returns a unique playbackId, which can be used to stream the live content.
A media platform needs to distribute a unique playback ID to users for an exclusive live concert. The platform can also embed the stream on various partner websites.
import { Fastpix } from "@fastpix/fastpix-node";
const fastpix = new Fastpix({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const result = await fastpix.livePlayback.createId({
streamId: "your-stream-id",
body: {},
});
console.log(result);
}
run();The standalone function version of this method:
import { FastpixCore } from "@fastpix/fastpix-node/core.js";
import { livePlaybackCreateId } from "@fastpix/fastpix-node/funcs/livePlaybackCreateId.js";
// Use `FastpixCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fastpix = new FastpixCore({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const res = await livePlaybackCreateId(fastpix, {
streamId: "your-stream-id",
body: {},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("livePlaybackCreateId failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.CreatePlaybackIdOfStreamRequest | ✔️ | 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. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CreatePlaybackIdOfStreamResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FastpixDefaultError | 4XX, 5XX | */* |
Deletes a previously created playback ID for a live stream.This prevents new viewers from accessing the stream using the playback ID, while current viewers can continue watching for a short period before the connection ends. FastPix deletes the ID and ensures the new playback request fails.
A streaming service wants to prevent new users from joining a live stream that is nearing its end. The host can delete the playback ID to ensure no one can join the stream or replay it once it ends.
import { Fastpix } from "@fastpix/fastpix-node";
const fastpix = new Fastpix({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const result = await fastpix.livePlayback.delete({
streamId: "your-stream-id",
playbackId: "your-playback-id",
});
console.log(result);
}
run();The standalone function version of this method:
import { FastpixCore } from "@fastpix/fastpix-node/core.js";
import { livePlaybackDelete } from "@fastpix/fastpix-node/funcs/livePlaybackDelete.js";
// Use `FastpixCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fastpix = new FastpixCore({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const res = await livePlaybackDelete(fastpix, {
streamId: "your-stream-id",
playbackId: "your-playback-id",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("livePlaybackDelete failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DeletePlaybackIdOfStreamRequest | ✔️ | 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. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.DeletePlaybackIdOfStreamResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FastpixDefaultError | 4XX, 5XX | */* |
Retrieves details for an existing playback ID. When you provide the playbackId returned from a previous stream or playback creation request, FastPix returns the associated playback information, including the access policy.
A developer needs to confirm the access policy of the playback ID to ensure whether the stream is public or private for viewers.
import { Fastpix } from "@fastpix/fastpix-node";
const fastpix = new Fastpix({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const result = await fastpix.livePlayback.get({
streamId: "your-stream-id",
playbackId: "your-playback-id",
});
console.log(result);
}
run();The standalone function version of this method:
import { FastpixCore } from "@fastpix/fastpix-node/core.js";
import { livePlaybackGet } from "@fastpix/fastpix-node/funcs/livePlaybackGet.js";
// Use `FastpixCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fastpix = new FastpixCore({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const res = await livePlaybackGet(fastpix, {
streamId: "your-stream-id",
playbackId: "your-playback-id",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("livePlaybackGet failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetLiveStreamPlaybackIdRequest | ✔️ | 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. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetLiveStreamPlaybackIdResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FastpixDefaultError | 4XX, 5XX | */* |