Lipoic 課堂功能實作討論
章節
技術
音視訊:WebRTC
文字:Socket.IO
WebRTC Rust 函式庫:https://github.com/webrtc-rs/webrtc
伺服器端範例 (rust):https://github.com/webrtc-rs/webrtc/tree/master/examples/examples/broadcast
SFU 伺服器端實作範例 (rust):https://github.com/webrtc-rs/examples/pull/15
Client 端範例 (js):https://jsfiddle.net/1jc4go7v/
API
課堂資料結構
菘菘 歡迎大家提供關於此 API 的建議
Payload 實際上是要用 form data,但 highlight 好像不支援,所以暫時用 json 表示。
建立課堂
Path: https://<host>/lesson
Method: POST
Payload
Response
加入課堂
Path: https://<host>/lesson/<id>/join
Method: POST
Payload
Response
Client 可以再利用伺服器給的 description 去加入 WebRTC 拿影像跟音訊資料
結束課堂
舉手
Path: https://<host>/lesson/<id>/user-state
發送課堂訊息
收回課堂訊息
使用者狀態
用於儲存課堂進行中使用者的狀態,像是舉手之類的。
目前有四種實作方式
- WebRTC (client-client)
- Webhook (server-client)
- Rest API (server-client)
透過資料庫儲存狀態
- Socket.IO (server-client)
存在記憶體 or 資料庫
Copyright © 2022 Lipoic. All rights reserved.
Dark Theme License
The MIT License (MIT)
Copyright © 2022-2024 Lumynous
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.