|
1 |
| -# 云端录制服务 |
2 |
| -## 服务简介 |
3 |
| -云端录制是声网为音视频通话和直播研发的录制组件,提供 RESTful API 供开发者实现录制功能,并将录制文件存至第三方云存储。云端录制有稳定可靠、简单易用、成本可控、方案灵活、支持私有化部署等优势,是在线教育、视频会议、金融监管、客户服务场景的理想录制方案。 |
| 1 | +# Cloud Recording Service |
4 | 2 |
|
5 |
| -## 环境准备 |
| 3 | +English | [简体中文](./README_ZH.md) |
6 | 4 |
|
7 |
| -- 获取声网App ID -------- [声网Agora - 文档中心 - 如何获取 App ID](https://docs.agora.io/cn/Agora%20Platform/get_appid_token?platform=All%20Platforms#%E8%8E%B7%E5%8F%96-app-id) |
| 5 | +## Service Introduction |
| 6 | +Cloud Recording is a recording component developed by Agora for audio and video calls and live broadcasts. It provides RESTful APIs for developers to implement recording functionality and store recording files in third-party cloud storage. Cloud Recording offers advantages such as stability, reliability, ease of use, cost control, flexible solutions, and support for private deployment, making it an ideal recording solution for online education, video conferences, financial supervision, and customer service scenarios. |
8 | 7 |
|
9 |
| - > - 点击创建应用 |
10 |
| - > |
11 |
| - >  |
| 8 | +## Environment Preparation |
| 9 | + |
| 10 | +- Obtain Agora App ID -------- [Agora Console](https://console.agora.io/v2) |
| 11 | + |
| 12 | + > - Click Create Application |
| 13 | + > |
| 14 | + >  |
12 | 15 | >
|
13 |
| - > - 选择你要创建的应用类型 |
14 |
| - > |
15 |
| - >  |
16 |
| -
|
17 |
| -- 获取App 证书 ----- [声网Agora - 文档中心 - 获取 App 证书](https://docs.agora.io/cn/Agora%20Platform/get_appid_token?platform=All%20Platforms#%E8%8E%B7%E5%8F%96-app-%E8%AF%81%E4%B9%A6) |
18 |
| - |
19 |
| - > 在声网控制台的项目管理页面,找到你的项目,点击配置。 |
20 |
| - >  |
21 |
| - > 点击主要证书下面的复制图标,即可获取项目的 App 证书。 |
22 |
| - >  |
23 |
| -
|
24 |
| -- 开启云录制服务 |
25 |
| - >  |
26 |
| - >  |
27 |
| - >  |
28 |
| -
|
29 |
| -## API 接口调用示例 |
30 |
| -### 获取云端录制资源 |
31 |
| -> 在开始云端录制之前,你需要调用 acquire 方法获取一个 Resource ID。一个 Resource ID 只能用于一次云端录制服务。 |
32 |
| -
|
33 |
| -需要设置的参数有: |
34 |
| -- appId: 声网的项目 AppID |
35 |
| -- username: 声网的Basic Auth认证的用户名 |
36 |
| -- password: 声网的Basic Auth认证的密码 |
37 |
| -- cname: 频道名 |
38 |
| -- uid: 用户 UID |
39 |
| -- 更多 clientRequest中的参数见 [Acquire](https://doc.shengwang.cn/doc/cloud-recording/restful/cloud-recording/operations/post-v1-apps-appid-cloud_recording-acquire) 接口文档 |
40 |
| - |
41 |
| -通过调用`acquire`方法来实现获取云端录制资源 |
| 16 | + > - Select the type of application you want to create |
| 17 | + > |
| 18 | + >  |
| 19 | +
|
| 20 | +- Obtain App Certificate ----- [Agora Console](https://console.agora.io/v2) |
| 21 | + |
| 22 | + > In the project management page of the Agora Console, find your project and click Configure. |
| 23 | + >  |
| 24 | + > Click the copy icon under Primary Certificate to obtain the App Certificate for your project. |
| 25 | + >  |
| 26 | +
|
| 27 | +- Check the status of the recording service |
| 28 | + >  |
| 29 | +
|
| 30 | +## API Call Examples |
| 31 | +### Acquire Cloud Recording Resources |
| 32 | +> Before starting cloud recording, you need to call the acquire method to obtain a Resource ID. A Resource ID can only be used for one cloud recording service. |
| 33 | +
|
| 34 | +Required parameters: |
| 35 | +- appId: Agora project AppID |
| 36 | +- username: Username for Agora Basic Auth authentication |
| 37 | +- password: Password for Agora Basic Auth authentication |
| 38 | +- cname: Channel name |
| 39 | +- uid: User UID |
| 40 | +- For more parameters in clientRequest, see the [Acquire](https://docs.agora.io/en/cloud-recording/reference/restful-api#acquire) API documentation |
| 41 | + |
| 42 | +Implement acquiring cloud recording resources by calling the `acquire` method |
42 | 43 | ```java
|
43 | 44 | String appId = "";
|
44 | 45 | String cname = "";
|
|
82 | 83 | }
|
83 | 84 | ```
|
84 | 85 |
|
85 |
| -### 开始云端录制 |
86 |
| -> 通过 acquire 方法获取云端录制资源后,调用 start 方法开始云端录制。 |
| 86 | +### Start Cloud Recording |
| 87 | +> After acquiring cloud recording resources through the acquire method, call the start method to begin cloud recording. |
87 | 88 |
|
88 |
| -需要设置的参数有: |
89 |
| -- cname: 频道名 |
90 |
| -- uid: 用户 UID |
91 |
| -- resourceId: 云端录制资源ID |
92 |
| -- mode: 云端录制模式 |
93 |
| -- storageConfig: 存储配置 |
94 |
| -- 更多 clientRequest中的参数见 [Start](https://doc.shengwang.cn/doc/cloud-recording/restful/cloud-recording/operations/post-v1-apps-appid-cloud_recording-resourceid-resourceid-mode-mode-start) 接口文档 |
| 89 | +Required parameters: |
| 90 | +- cname: Channel name |
| 91 | +- uid: User UID |
| 92 | +- resourceId: Cloud recording resource ID |
| 93 | +- mode: Cloud recording mode |
| 94 | +- storageConfig: Storage configuration |
| 95 | +- For more parameters in clientRequest, see the [Start](https://docs.agora.io/en/cloud-recording/reference/restful-api#start) API documentation |
95 | 96 |
|
96 |
| -通过调用`start`方法来实现开始云端录制 |
| 97 | +Implement starting cloud recording by calling the `start` method |
97 | 98 | ```java
|
98 | 99 | StartResourceReq.StorageConfig storageConfig = StartResourceReq.StorageConfig.builder()
|
99 | 100 | .accessKey("")
|
|
166 | 167 | }
|
167 | 168 | ```
|
168 | 169 |
|
169 |
| -### 停止云端录制 |
170 |
| -> 开始录制后,你可以调用 stop 方法离开频道,停止录制。录制停止后如需再次录制,必须再调用 acquire 方法请求一个新的 Resource ID。 |
| 170 | +### Stop Cloud Recording |
| 171 | +> After starting recording, you can call the stop method to leave the channel and stop recording. If you need to record again after stopping, you must call the acquire method again to request a new Resource ID. |
171 | 172 |
|
172 |
| -需要设置的参数有: |
173 |
| -- cname: 频道名 |
174 |
| -- uid: 用户ID |
175 |
| -- resourceId: 云端录制资源ID |
176 |
| -- sid: 会话ID |
177 |
| -- mode: 云端录制模式 |
178 |
| -- 更多 clientRequest中的参数见 [Stop](https://doc.shengwang.cn/doc/cloud-recording/restful/cloud-recording/operations/post-v1-apps-appid-cloud_recording-resourceid-resourceid-sid-sid-mode-mode-stop) 接口文档 |
| 173 | +Required parameters: |
| 174 | +- cname: Channel name |
| 175 | +- uid: User ID |
| 176 | +- resourceId: Cloud recording resource ID |
| 177 | +- sid: Session ID |
| 178 | +- mode: Cloud recording mode |
| 179 | +- For more parameters in clientRequest, see the [Stop](https://docs.agora.io/en/cloud-recording/reference/restful-api#stop) API documentation |
179 | 180 |
|
180 |
| -因为Stop 接口返回的不是一个固定的结构体,所以需要根据返回的serverResponseMode来判断具体的返回类型 |
| 181 | +Since the Stop interface does not return a fixed structure, you need to determine the specific return type based on the serverResponseMode returned |
181 | 182 |
|
182 |
| -通过调用`stop`方法来实现停止云端录制 |
| 183 | +Implement stopping cloud recording by calling the `stop` method |
183 | 184 | ```java
|
184 | 185 | StopResourceReq stopResourceReq = StopResourceReq.builder()
|
185 | 186 | .cname(cname)
|
|
203 | 204 |
|
204 | 205 | ```
|
205 | 206 |
|
206 |
| -### 查询云端录制状态 |
207 |
| -> 开始录制后,你可以调用 query 方法查询录制状态。 |
| 207 | +### Query Cloud Recording Status |
| 208 | +> After starting recording, you can call the query method to check the recording status. |
208 | 209 |
|
209 |
| -需要设置的参数有: |
210 |
| -- cname: 频道名 |
211 |
| -- uid: 用户ID |
212 |
| -- resourceId: 云端录制资源ID |
213 |
| -- sid: 会话ID |
214 |
| -- mode: 云端录制模式 |
215 |
| -- 更多 clientRequest中的参数见[Query](https://doc.shengwang.cn/doc/cloud-recording/restful/cloud-recording/operations/get-v1-apps-appid-cloud_recording-resourceid-resourceid-sid-sid-mode-mode-query)接口文档 |
| 210 | +Required parameters: |
| 211 | +- cname: Channel name |
| 212 | +- uid: User ID |
| 213 | +- resourceId: Cloud recording resource ID |
| 214 | +- sid: Session ID |
| 215 | +- mode: Cloud recording mode |
| 216 | +- For more parameters in clientRequest, see the [Query](https://docs.agora.io/en/cloud-recording/reference/restful-api#query) API documentation |
216 | 217 |
|
217 |
| -因为 Query 接口返回的不是一个固定的结构体,所以需要根据返回的serverResponseMode来判断具体的返回类型 |
| 218 | +Since the Query interface does not return a fixed structure, you need to determine the specific return type based on the serverResponseMode returned |
218 | 219 |
|
219 |
| -通过调用`query`方法来实现查询云端录制状态 |
| 220 | +Implement querying cloud recording status by calling the `query` method |
220 | 221 | ```java
|
221 | 222 | QueryResourceRes queryResourceRes = null;
|
222 | 223 |
|
|
258 | 259 | }
|
259 | 260 | ```
|
260 | 261 |
|
261 |
| -### 更新云端录制设置 |
262 |
| -> 开始录制后,你可以调用 update 方法更新如下录制配置: |
263 |
| -> * 对单流录制和合流录制,更新订阅名单。 |
264 |
| -> * 对页面录制,设置暂停/恢复页面录制,或更新页面录制转推到 CDN 的推流地址(URL)。 |
| 262 | +### Update Cloud Recording Settings |
| 263 | +> After starting recording, you can call the update method to update the following recording configurations: |
| 264 | +> * For individual recording and composite recording, update the subscription list. |
| 265 | +> * For web recording, set pause/resume web recording, or update the streaming URL for pushing web recording to CDN. |
265 | 266 |
|
266 |
| -需要设置的参数有: |
267 |
| -- cname: 频道名 |
268 |
| -- uid: 用户 UID |
269 |
| -- resourceId: 云端录制资源ID |
270 |
| -- sid: 会话ID |
271 |
| -- mode: 云端录制模式 |
272 |
| -- 更多 clientRequest中的参数见 [Update](https://doc.shengwang.cn/doc/cloud-recording/restful/cloud-recording/operations/post-v1-apps-appid-cloud_recording-resourceid-resourceid-sid-sid-mode-mode-update) 接口文档 |
| 267 | +Required parameters: |
| 268 | +- cname: Channel name |
| 269 | +- uid: User UID |
| 270 | +- resourceId: Cloud recording resource ID |
| 271 | +- sid: Session ID |
| 272 | +- mode: Cloud recording mode |
| 273 | +- For more parameters in clientRequest, see the [Update](https://docs.agora.io/en/cloud-recording/reference/restful-api#update) API documentation |
273 | 274 |
|
274 |
| -通过调用`update`方法来实现更新云端录制设置 |
| 275 | +Implement updating cloud recording settings by calling the `update` method |
275 | 276 | ```java
|
276 | 277 | UpdateResourceReq updateResourceReq = UpdateResourceReq.builder()
|
277 | 278 | .uid(uid)
|
|
302 | 303 | }
|
303 | 304 | ```
|
304 | 305 |
|
305 |
| -## 错误码和响应状态码处理 |
306 |
| -具体的业务响应码请参考 [业务响应码](https://doc.shengwang.cn/doc/cloud-recording/restful/response-code) 文档 |
| 306 | +## Error Codes and Response Status Codes |
| 307 | +For specific business response codes, please refer to the [Business Response Codes](https://docs.agora.io/en/cloud-recording/reference/common-errors) documentation |
0 commit comments