1
        options1 = {
            'method': 'POST',
            'url': 'https://api.agora.io/v1/apps/' + appID + '/cloud_recording/resourceid/' + resourceId + '/mode/2/start',
            'headers': {
                'Content-Type': 'application/json',
                'Authorization': 'Basic XXX'
            },
            body: JSON.stringify({
                "cname": "lol",
                "uid": "1",
                "clientRequest": {
                  "token": token,
                  "recordingConfig": {
                    "maxIdleTime": 30,
                    "streamTypes": 2,
                    "channelType": 0,
                    "videoStreamType": 0,
                    "transcodingConfig": {
                      "height": 640,
                      "width": 360,
                      "bitrate": 500,
                      "fps": 15,
                      "mixedVideoLayout": 1,
                      "backgroundColor": "#FF0000"
                    },
                    "subscribeVideoUids": [
                      "123",
                      "456"
                    ],
                    "subscribeAudioUids": [
                      "“123”",
                      "“456”"
                    ],
                    "subscribeUidGroup": 0
                  },
                  "recordingFileConfig": {
                    "avFileType": [
                      "hls"
                    ]
                  },
                  "storageConfig": {
                    "accessKey": config.writeAccessKeyId,
                    "region": 3,
                    "bucket": config.bucket,
                    "secretKey": config.writeSecretAccessKey,
                    "vendor": 1,
                    "fileNamePrefix": [
                      "directory1",
                      "directory2"
                    ]
                  }
                }
              })

        };

        request(options1, function (error, response, body) {
            if (error) throw new Error(error);
            console.log(response.statusCode);

我提到了 Agora 的 Cloud Recording API。身份验证和 resourceId 工作正常。response.statusCode 始终为 404。无法找到错误。我在 Postman 上进行了测试,但 URL 也无法正常工作。我可以知道是否输入了错误的任何属性吗?用户是否必须先加入频道才能开始录制?

4

2 回答 2

0

在您的 url 中,您指定了 mode/2/start。它应该是模式/混合/开始。

您可以在此处参考文档以获取更多信息: https ://docs.agora.io/en/cloud-recording/cloud_recording_api_rest?platform=All%20Platforms#parameters-1

于 2020-06-16T23:18:18.577 回答
0

云录制是否也适用于 Android 和 iOS?

于 2020-06-26T12:10:15.307 回答