webrtc-rails 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 223b136426d7cb271b1a46b9e98bf0ccf2fbd394
|
4
|
+
data.tar.gz: 87bd96f99254da54dc98924210dcd2aba81e38f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ffced78af7b77b13397d982f9ef62a255b754e055934b93cf5b9de64befc20efe82dc275292d32569f26bc63c7ac7d9cc50f694f14eb83842142103ab67fe0c
|
7
|
+
data.tar.gz: 131c3658bcbff1dcac74391a8109f2da000b4499ca8276b0ac342b0ae22714760240dc871d06d80112cb66c4630bca1ce3f8289e8d54646211b6443ab810a318
|
@@ -4,6 +4,7 @@ class @WebRTC
|
|
4
4
|
@CALLING: 2
|
5
5
|
|
6
6
|
myUserIdentifier: null
|
7
|
+
remoteUserIdentifier: null
|
7
8
|
|
8
9
|
onWebSocketConnected: ->
|
9
10
|
onWebSocketReconnectingStarted: ->
|
@@ -40,7 +41,7 @@ class @WebRTC
|
|
40
41
|
return
|
41
42
|
|
42
43
|
@_isCaller = true
|
43
|
-
@
|
44
|
+
@remoteUserIdentifier = remoteUserIdentifier
|
44
45
|
if !@_peerStarted && @_localStream
|
45
46
|
@_sendMessage(
|
46
47
|
type: 'call'
|
@@ -112,7 +113,7 @@ class @WebRTC
|
|
112
113
|
@_sendValue('setMyToken')
|
113
114
|
if @_wantWebRTCReconnecting
|
114
115
|
@_wantWebRTCReconnecting = false
|
115
|
-
@call(@
|
116
|
+
@call(@remoteUserIdentifier)
|
116
117
|
|
117
118
|
@_webSocket.onclose = (event) =>
|
118
119
|
unless @_isWebSocketReconnectingStarted
|
@@ -128,7 +129,7 @@ class @WebRTC
|
|
128
129
|
return
|
129
130
|
|
130
131
|
if eventType != 'myUserIdentifier' && eventType != 'call' && eventType != 'webSocketReconnected'
|
131
|
-
if @
|
132
|
+
if @remoteUserIdentifier != event['remoteUserIdentifier']
|
132
133
|
return
|
133
134
|
|
134
135
|
switch eventType
|
@@ -144,7 +145,7 @@ class @WebRTC
|
|
144
145
|
@onWebSocketConnected()
|
145
146
|
@_webSocketConnected = true
|
146
147
|
when 'webSocketReconnected'
|
147
|
-
if @_hangedUp || @
|
148
|
+
if @_hangedUp || @remoteUserIdentifier != event['remoteUserIdentifier']
|
148
149
|
@_sendMessageToOther(type: 'hangUp', event['remoteUserIdentifier'])
|
149
150
|
when 'callFailed'
|
150
151
|
@_callAnswerReceived = true
|
@@ -158,8 +159,8 @@ class @WebRTC
|
|
158
159
|
else if event['reconnect'] && @_hangedUp
|
159
160
|
@_sendMessage(type: 'hangUp')
|
160
161
|
else
|
161
|
-
@
|
162
|
-
@onWebRTCCall(@
|
162
|
+
@remoteUserIdentifier = event['remoteUserIdentifier']
|
163
|
+
@onWebRTCCall(@remoteUserIdentifier)
|
163
164
|
when 'hangUp'
|
164
165
|
@_callAnswerReceived = true
|
165
166
|
@_hangUp()
|
@@ -211,7 +212,7 @@ class @WebRTC
|
|
211
212
|
)
|
212
213
|
|
213
214
|
_sendMessage: (message) ->
|
214
|
-
@_sendMessageToOther(message, @
|
215
|
+
@_sendMessageToOther(message, @remoteUserIdentifier)
|
215
216
|
|
216
217
|
_startOutput: (localOutput) ->
|
217
218
|
isVideo = (@localOutput? && @localOutput.tagName.toUpperCase() == 'VIDEO')
|
@@ -303,7 +304,7 @@ class @WebRTC
|
|
303
304
|
if @_isCaller
|
304
305
|
@_webRTCReconnecting = true
|
305
306
|
if @_webSocket.readyState == WebSocket.OPEN
|
306
|
-
@call(@
|
307
|
+
@call(@remoteUserIdentifier)
|
307
308
|
else
|
308
309
|
@_wantWebRTCReconnecting = true
|
309
310
|
|
data/lib/webrtc_rails/version.rb
CHANGED