当前位置:网站首页>Easyrtc call error `failed to execute'send'on'rtcdatachannel'
Easyrtc call error `failed to execute'send'on'rtcdatachannel'
2022-06-24 06:26:00 【Tsingsee green rhino video】
WebRTC The existence of Internet brings a new mode to online video conference system ,TSINGSEE Qingxi video development of web video conference system EasyRTC A combination of webrtc and rtmp/rtsp The advantages of the scheme , Support one-to-one 、 One to many video conference interactive calls , Meet voice social networking 、 Online education and training 、 Video conference and telemedicine , new EasyRTC The project will meet you soon .
In the test EasyRTC The new version of point-to-point call function , There is an error :Failed to execute ‘send’ on ‘RTCDataChannel’: RTCDataChannel.readyState is not ‘open’, And can not successfully send messages to the other party .
See the code below :
// Instantiate the send channel
sendChannel = localConnection.createDataChannel('webrtc-datachannel');
//onopen Event monitoring
sendChannel.onopen = this.onSendChannelStateChange;
//onclose Event monitoring
sendChannel.onclose = this.onSendChannelStateChange;The above code does not find errors , Therefore, it is suspected that the problem of calling sequence leads to . Look at the code again , Found sending offer After the message , The corresponding data transmission channel is created , The problem may arise here .
To solve this problem , We will adjust the code sequence as follows :
// Instantiate the send channel
sendChannel = localConnection.createDataChannel('webrtc-datachannel');
//onopen Event monitoring
sendChannel.onopen = this.onSendChannelStateChange;
//onclose Event monitoring
sendChannel.onclose = this.onSendChannelStateChange;
try {
console.log('localConnection Create proposal Offer Start ');
// Create proposal Offer
const offer = await localConnection.createOffer();
// establish Offer success
await this.onCreateOfferSuccess(offer);
} catch (e) {
// establish Offer Failure
this.onCreateSessionDescriptionError(e);
}After modification , Can send messages normally .
边栏推荐
- Text classification and fine tuning using transformer Bert pre training model
- A letter from little potato
- How to batch move topics to different categories in discover
- Vscode1.58 version update record Previous + related article summary
- Tencent Security jointly established a data security committee
- DHCP server setup
- TRTC applet custom message
- How to open a hidden file
- Micro build low code supports Excel to import data source
- How accurate are the two common methods of domain name IP query
猜你喜欢

One line of keyboard
Oracle case: ohasd crash on AIX

Enter the software test pit!!! Software testing tools commonly used by software testers software recommendations

The product layout is strengthened, the transformation of digital intelligence is accelerated, and FAW Toyota has hit 2022million annual sales
Fault analysis | using --force to batch import data leads to partial data loss
![[fault announcement] one stored procedure brings down the entire database](/img/7c/e5adda73a077fe4b8f04b59d1e0e1e.jpg)
[fault announcement] one stored procedure brings down the entire database

ServiceStack. Source code analysis of redis (connection and connection pool)

A cigarette of time to talk with you about how novices transform from functional testing to advanced automated testing

What is the difference between a white box test and a black box test

Manual for automatic testing and learning of anti stepping pits, one for each tester
随机推荐
Reasons for automatic allocation failure of crawler agent IP
Water conservancy RTU telemetry terminal
The errorcontrol registry of the third-party service is 3, which may cause the system to cycle restart. For example, ldpkit introduced by WPS
Innovating the security service mode, deeply convinced that the organization has been equipped with a "continuous online expert group"
A high-end router antenna connection mechanism that can simultaneously deploy and store antennas
Easycvr is cascaded to easygbs through gb28181 protocol. Notes on video channel failure
Forbid viewing source code in web page (protect source code)
WordPress pill applet build applet from zero to one [install and configure WordPress site]
[in depth sharing] Devops evolution path -- Realizing R & D digital transformation based on four vertical and four horizontal Devops system
Analysis and treatment of easydss flash back caused by system time
Risc-v instruction set explanation (7) instruction address alignment and addition and subtraction overflow processing
How to choose CMS website system for website construction
Printer connection mode
The new version of Tencent Youtu ncnn is suitable for domestic CPUs, and the maximum speed is increased by 70 times
5 minutes, online from 0 to 1!
The product layout is strengthened, the transformation of digital intelligence is accelerated, and FAW Toyota has hit 2022million annual sales
Micro build low code supports Excel to import data source
Web automated testing (2): choose selenium advantage? Comparison with phantomjs/qtp/monkey
Manual for automatic testing and learning of anti stepping pits, one for each tester
What is domain name resolution? How to resolve domain name resolution errors