首页 > 解决方案 > Twilio 可编程视频 API - 房间创建

问题描述

我目前正在开发一个节点应用程序并使用 Twilio Programmable video api 创建房间:这里是代码

twilioClient.video.rooms.create({
            type: 'group',
            uniqueName: uniqueName,
            maxParticipants: maxParticipants,
            endTime: new Date(new Date().getTime() + 500000).toISOString(),
            duration: 100
        }).then(room => {
            console.log("room is >>>>:", room);

我将持续时间设置为 100,但通话的持续时间仅为 5 分钟。

这是调用的 json 对象:

{
  sid: 'xxxxxxx',
  status: 'in-progress',
  dateCreated: 2020-08-26T18:58:11.000Z,
  dateUpdated: 2020-08-26T18:58:11.000Z,
  accountSid: 'xxxxxxx',
  enableTurn: true,
  uniqueName: 'workout-8940715',
  uniqueName: 'workout-8940715',
  statusCallback: null,
  statusCallbackMethod: 'POST',
  endTime: null,
  duration: null,
  type: 'group',
  maxParticipants: 12,
  recordParticipantsOnConnect: true,
  videoCodecs: [ 'H264', 'VP8' ],
  mediaRegion: 'us1',
  url: 'https://video.twilio.com/v1/Rooms/xxxxx',
  links: {
    recordings: 'https://video.twilio.com/v1/Rooms/xxxxxx/Recordings',
    participants: 'https://video.twilio.com/v1/Rooms/xxxxxx/Participants'
  }
}

我在这里做错了什么?

标签: twilio

解决方案


是这个吗?持续时间也是秒。API 响应说:

  endTime: null,   duration: null,

首次加入超时:第一个参与者必须在房间创建后 5 分钟内加入。否则房间被摧毁。

房间休息 API


推荐阅读