import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.stream.addMultistreamTarget({
profile: "720p0",
videoOnly: false,
id: "PUSH123",
spec: {
name: "My target",
url: "rtmps://live.my-service.tv/channel/secretKey",
},
}, "<id>");
// Handle the result
console.log(result);
}
run();{
"errors": [
[
"id not provided",
"Account not found"
]
]
}Add a multistreaming target to a livestream
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.stream.addMultistreamTarget({
profile: "720p0",
videoOnly: false,
id: "PUSH123",
spec: {
name: "My target",
url: "rtmps://live.my-service.tv/channel/secretKey",
},
}, "<id>");
// Handle the result
console.log(result);
}
run();{
"errors": [
[
"id not provided",
"Account not found"
]
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ID of the parent stream
Name of transcoding profile that should be sent. Use "source" for pushing source stream data
1 - 500"720p0"
If true, the stream audio will be muted and only silent video will be pushed to the target.
false
ID of multistream target object where to push this stream
"PUSH123"
Inline multistream target object. Will automatically create the target resource to be used by the created stream.
Show child attributes
Success (No content)
Was this page helpful?