preface

Recently, there is a project that needs to use The CallLib SDK of Rongyun to realize a video call similar to wechat. So BEFORE the project is officially launched, I have secretly started to integrate it, so as not to work overtime when I am not familiar with it, I really want to cry without tears. The good news is that I have used the IMLib SDK of Rongyun home to do instant messaging function, so the whole registration process and the use of the developer background has been more familiar, of course, it doesn’t matter if the instant not familiar, follow their documents step by step, also can quickly get started. Rongyun official website: www.rongcloud.cn/

Here are some of the issues that need to be addressed when integrating:

1. The Web site must be localhost or HTTPS 2. The CallLib call can be made only after the IM connection is successful 3

In conclusion, I will answer them one by one, about the specific integration can directly reference: docs. Rongcloud. Cn/v4 / views/rt…

There are specific demo can also refer to github.com/rongcloud-s…

Web sites must be localhost or HTTPS: This is the use of the cloud of the preconditions, audio and video calling when local debugging thoroughly originally, but released to online time can’t use, finally submitted to the repair order asked if cloud technology personnel online what, also need to configure the final screen once found in a production environment using site is HTTP (want to cry…). , children shoes as a warning ah!!

You can make a CallLib call only after successfully connecting to IM.

Const im = rongimlib. init({appKey: '< your-appKey >'})// Add event listener im.watch({// connect status listener status(evt) {console.log(' connect status code :', evt.status); }, // Message listening message(evt) {console.log(' new message received :', evt.message); Var config = {timeout: 20000, RongIMLib: RongIMLib, RongRTC: RongRTC}; var config = {timeout: 20000, RongIMLib: RongIMLib, RongRTC: RongRTC}; rongCallLib = RongCallLib.init(config); Server APIconst token = 'im.connect({token}).then(user => {console.log(' link successfully, link user ID: ', user.id); }). Catch (error => {console.log(' link failed: ', err.code, err.msg); });Copy the code

Update the SDK to the latest version of the RTC SDK at cdn.ronghub.com/RongRTC-3.2… Note that if you are using SDK 2.x, you also need to upgrade to above 2.5.10

The audio and video call can not be connected: I summarize and analyze several cases of this situation, as follows:

Code pass parameter error or writing error this seems to have nothing to say, can only blame yourself not careful! Follow the document

Rongcalllib. hungup: no hungup, rongcalllib. hungup: no hungup, rongcalllib. hungup Otherwise, an error message will be displayed next time, indicating that the caller is busy

How to identify hang up reason HungupMessage message in a tiny fields and SummaryMessage message in the status field is hang up, details address reference: docs. Rongcloud. Cn/RTC/calllib…

Because the integration of audio and video has just begun and is still learning. In the future, as we continue to go deeper, we will also synchronize the integration problems related to audio and video, so as to facilitate the review and record, and hope to help the children’s shoes in need!!