Comments (6)
Finally, I've found out the problem. AioRTC does not use "addCandidates" or "sendCandidates", it only uses "createOffer", "createAnswer", "setLocalDescription" and "setRemoteDescription", so candidates MUST be included in offers/answers. My problem was browser offer and aiortc peer answer did not include candidates.
To solve it, I had to create offer/answer again after browser starts sending ice candidates and ice candidate status changed to "checking".
Something like this:
localPeer.oniceconnectionstatechange = function(event) {
trace("ICE Candidate State: " + localPeer.iceConnectionState);
trace("ICE Gathering State: " + localPeer.iceGatheringState);
// Create offer again and send it to remote peer with new candidates
if(localPeer.iceConnectionState == "checking") {
console.log("It is checking right now");
localPeer.createOffer(offerOptions).then(
function(offer) {
//console.log('New offer created: ' + JSON.stringify(offer))
localPeer.setLocalDescription(offer);
sendNegotiation("offer", offer);
},
function(err) {
console.log('Error creating new offer');
}
);
}
};
In addition, I had to add to "rtcicetransport.py" RTCIceGatherer initializer a turn server to solve NAT issues.
from aiortc.
Hi Charlie, indeed this is documented in the README : ICE Trickle isn't yet supported.
I plan to eventually I'd like to add support for this, the initial step being to add support for ICE trickle to aioice:
https://github.com/jlaine/aioice/issues/4
from aiortc.
Hi @jlaine,
Its true, you documented it in the README, but it was not clear enough for me. This is why I've tried to connect both peers, making some tricks.
Anyway, any support for ICE trickle is appreciated. Hope you could update it soon.
Thanks so much.
In addition, a modification in RTCPeerConnection constructor to support adding custom STUN and TURN servers will be appreciated as well, as it is reflected in this issue: jlaine/aiortc#13
from aiortc.
I believe I'm running onto the same issue. Is there any way to disable ICE Trickle on the browser?
from aiortc.
iceCandidatePoolSize does prefetching of ICE candidates avoiding sending an offer with no candidates
var pc = new RTCPeerConnection({
sdpSemantics: 'unified-plan', //newer implementation of WebRTC
iceServers: [{urls: 'stun:stun.l.google.com:19302'}],
iceCandidatePoolSize: 2
});
from aiortc.
I got the same issue. Because my project was originally written in JS which has a listener for ice candidates and then call back WebSocket to send it.
now, I have to change the plan.
Your solution really inspire me, thanks
from aiortc.
Related Issues (20)
- [Example][Server] MediaRecorder is not saving audio (mp3) from the web HOT 2
- Establish one-way video from server to client HOT 2
- Data channel stuck in connecting state while still receiving messages on it HOT 1
- Request for Guidance on Extracting WHEP Save as MP4 Files from AIORTC
- MediaPlayer HTTP stream from the same EndPoint does work
- Cannot connect to video stream: BINDING ERROR / 400 Bad Request HOT 1
- Can aiortc module be used for professional or semi-professional use?
- Implement MediaStreamTrack.enabled HOT 3
- Setting RTCRtpTransceiver.direction to `inactive` does not have any effect HOT 1
- Issue encountered when installing aiortc from source
- JS and PYTHON communication are available in the LAN, and the Internet connection fails HOT 1
- 'server' example failed when served in a remote machine HOT 2
- example videostream-cli not working HOT 1
- addTrack failing inside datachannel message receive handler
- chopping sounds with AudioStreamTrack HOT 2
- Recording video on server discards beyond a few seconds.
- Combining multiple mp3 files to be returned as a single MediaStreamTrack
- Server Python to Client Python Q/A (INCLUDE FULL SCRIPTS!)
- Webrtc initial negotiation succeeds but renegotiation fails
- Set packet_time = 125 msec instead of 20 msec (both side) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiortc.