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"
]
]
}将多流传输目标添加到直播流
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.
显示 子属性
Success (No content)
此页面对您有帮助吗?