You can perform online live interactive teaching through recorded teaching videos combined with AI technology.
Before class, the knowledge point explanation, interactive questions, question feedback and answers are recorded into video segments and uploaded to the video library based on the teaching curriculum. In the class, the existing recorded video is pushed to the TRTC room for live broadcasting through the SCF. Students can perform interactive learning through voice and touchscreen. Through the AI technology, the server can intelligently recognize students' voice chats and answers, and seamlessly switch teaching segments based on students' performance, and give different feedbacks in real time, so as to provide a personalized teaching.
For live streaming such as games, shows, and sports events, RTMP live stream can be pushed to TRTC room through SCF for real-time communication and driving hotspot. For VOD programs such as movies and music, the media files can be converted into online media streams and input to TRTC rooms through SCF, providing value-added services and creating a community. SCF features one-click triggering, OPS-free operation, and auto scaling, which can quickly support the construction of real-time interactive entertainment and social applications. With programmability, SCF can quickly integrate other Tencent Cloud services and third-party services to expand businesses, and innovate usages efficiently.
This document describes how to use API gateway to integrate SCF to push the recorded videos or RTMP live stream to TRTC room for live broadcasting, providing an out-of-the-box, flexible, convenient, and programmable online media stream input capabilities. If you need to enable real-time records of the pushed live stream, you can use Redis, and the API gateway will write the progress to Redis in real time. The workflow is shown in the figure below:
The parameters for calling API are as follows:
|videoSrc||String||Yes||The pushed video streams|
|sdkAppId||String||Yes||App ID, which is used to distinguish different TRTC applications.|
|roomId||String||Yes||Room ID, which is used to uniquely identify a room in a TRTC application.|
|userId||String||Yes||User ID, which is used to uniquely identify a user in a TRTC application.|
|userSig||String||Yes||User signature, which is used to authenticate the user login.|
|clientRole||String||No||Role name. Default value: anchor|
|redis||Boolean||No||Whether to use Redis. Default value: false|
|redisHost||String||No||The host address of Redis when redis is set as true.|
|redisPort||Integer||No||The port number for accessing Redis when redis is set as true.|
|redisPassword||String||No||The password for accessing redis when redis is set as true.|
- If the redis is set as false, when the stream is pulled from videoSrc video stream for live stream push, the live stream will start from the latest.
- If the redis is set as true, for the same videoSrc video stream, the API gateway will first check in redis whether there is a record of the last live stream push:
- If there is a record, the last stream push will be restored.
- If there is no record, the stream push will be started again. The progress of pushing the live stream is written to Redis in real time through callbacks.