Don't work connection open event

98 views
Skip to first unread message

Vladimir Amelin

unread,
Jan 11, 2016, 9:08:30 AM1/11/16
to PeerJS
Hi. Don't work connection open event. My code:

_this.peer.on('connection', function(connn) {
        _this
.conn = connn;
       
       
if(_this.dataReceive == false) {
            _this
.conn.on('open', function() {
                 
// Receive messages
                _this
.conn.on('data', function(data) {
                     
                   
if(data == 'cancel_call') {
                         
//_this.conn.close();    
                          $
('#their-video').prop('src', null);
                          _this
.connect = 'false';
                          _this
.findPeople.findPeoplesAfterError(_this.peopleUserId,3);
                   
}

i.e. work event connection. But sometimes don't work open event after making a connection.
Prompt please why don't work? Thanks
Reply all
Reply to author
Forward
0 new messages