Comments (8)
chrome is error .. but firefox is ok. You try firefox.
from webrtc-web.
Even Firefox has same issue.
from webrtc-web.
I was able to reproduce the error and identify where the issue is, but not yet the root cause.
What seems to be happening here is that dataChannel.send(len); is throwing an error because dataChannel is undefined.
This seems to be happening when the channel between the two client has not been established.
This potentially means that line 280 was not executed or ondatachannel was never completed
This can be confirmed because the console does not seem to be showing "CHANNEL opened!!!" as opposed to this scenario where all works normally:
Further research needed.
from webrtc-web.
The only way I seem to be able to reproduce this consistently is by:
- Opening one tab. It creates the room and dataChannel.
- Opening a second tab. It joins and connects to the dataChannel.
- Refresh original tab.
This seems to be detecting itself as not the initiator, and it tries to make a connection. My understanding is that the other peer never created the channel to which to connect and then, this dataChannel connection is not effective.
Doing this I get almost the same console results than the exposed here.
@shamidrasool Could this be how you identified the issue?
As for what might be happening, still more research needed, but I would say that this code:
peerConn.ondatachannel = function(event) {
console.log('ondatachannel:', event.channel);
dataChannel = event.channel;
onDataChannelCreated(dataChannel);
};
is not triggered under this circumstance.
dataChannel is defined there as event.channel which would allow to do the dataChannel.send()
The log "'ondatachannel:', event.channel" is not shown on this case, which could confirm it.
from webrtc-web.
Is there a solution for this behavior?
from webrtc-web.
@transonly Hello Ingrid, sorry for the inconvenience. At the moment, we have still not deep dive here; but I was able to reproduce the issue. I will try to come up with a fix before end of next week.
from webrtc-web.
Quick update here:
Currently working on this on nitobuendia:patch-2.
I have been able to detect most cases where connection was closed. However, connection may have been re-opened and that's not fully smooth.
To solve that issue I am trying to detect when a peer leaves and refresh the connection for all remaining peers. It might not be the smoothest way to do it, but it could work. If I get that fully working, we could consider taking a step extra and simply trying a room re-create / re-join without refresh.
Working on it.
from webrtc-web.
Quick update here. I am handling mainly two situations:
-
Peer never connected >> on this situation a warning is fired explaining a picture cannot be sent until connection is made. We could as well enable / disable buttons, but this seems a fair fix for this issue for now. Further contributions can make it better.
-
Peer disconnected >> on this situation, we need to manage the re-connection. In general, my first line of work is simply re-create the room. However, I want to manage immediate re-connections to avoid doing this and to avoid an infinite loop of peer join-leave reconnections. That's where I am at right now. I will keep working on it.
from webrtc-web.
Related Issues (20)
- Typo on Codelabs Step 2 Bonus Points
- Typo in Exercise 4 of codelabs in the Bonus Points section
- Typo in Exercise 5 of googlecodelabs Bonus Points
- audio is not receiving iphone safari
- step-06- message.type==='offer'
- Broken Link on exercise 1
- Broken HOT 1
- Using legacy `offerToReceiveVideo` in step 2 HOT 1
- error HOT 2
- The requested URL alias for "/" is not defined.
- Step.8 add ICEServer fail in step-05 folder HOT 1
- socket.IO.listen is not a function HOT 3
- Exercise 4 doesn't work because we're serving over http instead of https
- wrong variable name / typo
- Scroll position is not at start page when I go to next page
- [DOC] To inspect the `localStream` object, type `localStream` instead of `stream`
- multi player with webrtc-web on mobile
- How to make STUN or TURN working in Example 5
- Fix typo in explanation of adapter.js shim
- [ERROR] Web Server for Chrome Extension Is Outdated : WebRTC
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 webrtc-web.