-
Clone the project
git clone https://github.com/your-username/your-project.git cd your-project
-
Edit Configure
Replace the configuration file src/main/resources/application.yml with your project values
agora: domain: https://api.agora.io appid: your-app-id key: your-key secret: your-secret channel: your-channel uid: your-uid channelProfile: your-channel-profile appliteDir: /your/custom/path/to/AgoraRecord/bin recordFileRootDir: /your/custom/path/to/tmp lowUdpPort: your-low-udp-port highUdpPort: your-high-udp-port triggerMode: your-trigger-mode isAudioOnly: your-is-audio-only isVideoOnly: your-is-video-only streamType: your-stream-type autoSubscribe: your-auto-subscribe
-
Compile
mvn clean package
-
Deploy
java -jar target/your-project.jar &
Endpoint | HTTP Method | Request Type | Request Body | Response Status Codes | Response Body |
---|---|---|---|---|---|
/record/getProp |
GET |
- | None | 200 - 5XX | Default recording configuration information |
/record/test |
GET |
- | None | 200 - 5XX | "test ok" |
/record/start |
POST |
JSON | { "appId": "string", "channel": "string", "uid": "string" } |
200 - 5XX | "Recording started successfully" or Error message |
/record/stop |
POST |
Query Parameter | None | 200 - 5XX | "Recording stop successfully" or Error message |
/record/help |
GET |
- | None | - | Help message with available commands |
本地录制环境搭建参考: Agora 本地录制最全总结- 基于Java SDK
-
克隆项目到本地
git clone https://github.com/your-username/your-project.git cd your-project
-
修改配置 将 src/main/resources/application.yml 文件中的以下配置替换为你的项目值
agora: domain: https://api.agora.io appid: your-app-id key: your-key secret: your-secret channel: your-channel uid: your-uid channelProfile: your-channel-profile appliteDir: /your/custom/path/to/AgoraRecord/bin recordFileRootDir: /your/custom/path/to/tmp lowUdpPort: your-low-udp-port highUdpPort: your-high-udp-port triggerMode: your-trigger-mode isAudioOnly: your-is-audio-only isVideoOnly: your-is-video-only streamType: your-stream-type autoSubscribe: your-auto-subscribe
-
编译与打包
mvn clean package
-
部署运行
java -jar target/your-project.jar &
Endpoint | HTTP Method | Request Type | Request Body | Response Status Codes | Response Body |
---|---|---|---|---|---|
/record/getProp |
GET |
- | None | 200 - 5XX | Default recording configuration information |
/record/test |
GET |
- | None | 200 - 5XX | "test ok" |
/record/start |
POST |
JSON | { "appId": "string", "channel": "string", "uid": "string" } |
200 - 5XX | "Recording started successfully" or Error message |
/record/stop |
POST |
Query Parameter | None | 200 - 5XX | "Recording stop successfully" or Error message |
/record/help |
GET |
- | None | - | Help message with available commands |