阿里rtc旁路推流TypeScript版NODE运行

阿里云音视频服务云端录制typescript版本; 编译后可以使用 node index.js运行

package.json 版本
// npm install --save @alicloud/rtc20180111@2.3.0
"@alicloud/rtc20180111": "^2.3.0",
引入
import Client, { StartCloudRecordRequest, StopCloudRecordRequest, DescribeAppRecordingFilesRequest} from "@alicloud/rtc20180111";
import * as Util from "@alicloud/tea-util";
创建客户端
// @ts-ignore:
const client = new Client({
  endpoint: "rtc.aliyuncs.com",
  accessKeyId: "",
  accessKeySecret: "",
  type: "access_key",
  regionId: "cn-hangzhou"
});
旁路推流开始
const startStreamingOutRequest = new rtc20180111_1.StartStreamingOutRequest({
    appId: "",
    // 频道 ID
    channelId: '',
    // 直播推流地址,仅支持传单个地址
    url: '',

})
// 03D06E77-5916-53B3-A2F6-48DA78E262D7
client.startStreamingOut(startStreamingOutRequest).then((res) => {
    console.log('旁路推流开始_任务成功', res);
}).catch((error) => {
    console.log('旁路推流开始_任务失败', error);
});
旁路推流结束
const stopStreamingOutRequest = new rtc20180111_1.StopStreamingOutRequest({
    appId: "",
    // 频道 ID
    channelId: '',
    // 任务id
    taskId: '',
});
client.stopStreamingOut(stopStreamingOutRequest).then((res) => {
    console.log('旁路推流结束_任务成功', res);
}).catch((error) => {
    console.log('旁路推流结束_任务失败', error);
});
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值