webrtc-rails 0.3.4 → 0.3.5

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: dd2ef1d36f62dbb2cc13004bf6c52a9559346bb6
4
- data.tar.gz: 0b83828c0c610f8bc2479da73bba332205f1d384
3
+ metadata.gz: 83913fb945b62320d8d09c983930387175fdda6c
4
+ data.tar.gz: 23ad77bb9c1d76b682b12b44147cdbf00a725d29
5
5
  SHA512:
6
- metadata.gz: 6f5a5d4e3f7cb64e7abdf132fe72dfd48270216f8b110b4c1dcddfa9996b61d15775c88b3b7db1735813c47cf3a51c995810ac26d86d32ad3a4ad9f95e3ec9c6
7
- data.tar.gz: a679afaea6a393276774b44226cc12b7769291b0a15ae0482b7dc2765b3c1743cb5db342cea1a7a604b8a74a84e3f5a75d5656d267ad7b010e3d7a9647315d25
6
+ metadata.gz: 185c56774b8c14c928ccb6a7981d8db676e75ec725cea5896d40a5e85e91a8b620847e0b4e8903fbb0452994e1b8b9f52558350d3c6d331d4c29751e01e6a8be
7
+ data.tar.gz: 19c44ccc0c347e78292252f13703231ca6344d974169832823bc311ec6690fca358777a29c493b338c52340768d0a1e41e92123f974009923dfe83bfcb6ff6c7
@@ -42,7 +42,7 @@ class @WebRTC
42
42
  =>
43
43
  unless @_callAnswerReceived
44
44
  if @_webRTCReconnecting
45
- @connect(remoteUserIdentifier)
45
+ @call(remoteUserIdentifier)
46
46
  else
47
47
  @onWebRTCConnectFailed(WebRTC.TIMEOUT)
48
48
  5000
@@ -90,6 +90,10 @@ class @WebRTC
90
90
  'OfferToReceiveAudio': true
91
91
  'OfferToReceiveVideo': true
92
92
 
93
+ _RTCIceCandidate: window.RTCIceCandidate || window.mozRTCIceCandidate || window.webkitRTCIceCandidate || window.msRTCIceCandidate
94
+ _RTCSessionDescription: window.RTCSessionDescription || window.mozRTCSessionDescription || window.webkitRTCSessionDescription || window.msRTCSessionDescription
95
+ _RTCPeerConnection: window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection || window.msRTCPeerConnection
96
+
93
97
  _webSocketInitialize: (url, userToken) ->
94
98
  @_userToken = userToken
95
99
  @_webSocket = new WebSocket(url)
@@ -98,7 +102,7 @@ class @WebRTC
98
102
  @_sendValue('setMyToken')
99
103
  if @_wantWebRTCReconnecting
100
104
  @_wantWebRTCReconnecting = false
101
- @connect(@_remoteUserIdentifier)
105
+ @call(@_remoteUserIdentifier)
102
106
 
103
107
  @_webSocket.onclose = (event) =>
104
108
  unless @_isWebSocketReconnectingStarted
@@ -201,7 +205,8 @@ class @WebRTC
201
205
 
202
206
  _startOutput: (localOutput) ->
203
207
  isVideo = (@localOutput? && @localOutput.tagName.toUpperCase() == 'VIDEO')
204
- navigator.webkitGetUserMedia(
208
+ navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia
209
+ navigator.getUserMedia(
205
210
  video: isVideo
206
211
  audio: true
207
212
  (stream) =>
@@ -225,7 +230,7 @@ class @WebRTC
225
230
  @_setAnswer(event)
226
231
 
227
232
  _onCandidate: (event) ->
228
- candidate = new RTCIceCandidate(
233
+ candidate = new @_RTCIceCandidate(
229
234
  sdpMLineIndex: event.sdpMLineIndex
230
235
  sdpMid: event.sdpMid
231
236
  candidate: event.candidate
@@ -239,7 +244,7 @@ class @WebRTC
239
244
  @_sendMessage(candidate)
240
245
 
241
246
  _prepareNewConnection: ->
242
- pcConfig = 'iceServers': [ "url": "stun:stun.l.google.com:19302" ]
247
+ pcConfig = 'iceServers': [ "urls": "stun:stun.l.google.com:19302" ]
243
248
  peer = null
244
249
 
245
250
  onRemoteStreamAdded = (event) =>
@@ -249,7 +254,7 @@ class @WebRTC
249
254
  @remoteOutput.src = ''
250
255
 
251
256
  try
252
- peer = new webkitRTCPeerConnection(pcConfig)
257
+ peer = new @_RTCPeerConnection(pcConfig)
253
258
  catch e
254
259
  console.log('Failed to create peerConnection, exception: ' + e.message)
255
260
 
@@ -288,7 +293,7 @@ class @WebRTC
288
293
  if @_isCaller
289
294
  @_webRTCReconnecting = true
290
295
  if @_webSocket.readyState == WebSocket.OPEN
291
- @connect(@_remoteUserIdentifier)
296
+ @call(@_remoteUserIdentifier)
292
297
  else
293
298
  @_wantWebRTCReconnecting = true
294
299
 
@@ -307,7 +312,7 @@ class @WebRTC
307
312
  if @_peerConnection
308
313
  console.error('peerConnection alreay exist!')
309
314
  @_peerConnection = @_prepareNewConnection()
310
- @_peerConnection.setRemoteDescription(new RTCSessionDescription(event))
315
+ @_peerConnection.setRemoteDescription(new @_RTCSessionDescription(event))
311
316
 
312
317
  _sendAnswer: (event) ->
313
318
  if !@_peerConnection
@@ -326,7 +331,7 @@ class @WebRTC
326
331
  if !@_peerConnection
327
332
  console.error('peerConnection NOT exist!')
328
333
  return
329
- @_peerConnection.setRemoteDescription(new RTCSessionDescription(event))
334
+ @_peerConnection.setRemoteDescription(new @_RTCSessionDescription(event))
330
335
 
331
336
  _hangUp: ->
332
337
  @_stop()
@@ -335,7 +340,6 @@ class @WebRTC
335
340
 
336
341
  _stop: ->
337
342
  if @_peerConnection?
338
- @_peerConnection.removeStream(@_peerConnection.getRemoteStreams()[0])
339
343
  @_peerConnection.close()
340
344
  @_peerConnection = null
341
345
  @_peerStarted = false
@@ -56,7 +56,7 @@ module WebrtcRails
56
56
  if data[:event] != 'heartbeat'
57
57
  token = data[:token]
58
58
  if token.present?
59
- user = @user_class.send(@fetch_user_by_token_method, token)
59
+ user = @user_class.send(@fetch_user_by_token_method, token.to_s)
60
60
  my_user_identifier = user ? user.send(@user_identifier).to_s : nil
61
61
  if my_user_identifier.present?
62
62
  case data[:event]
@@ -1,3 +1,3 @@
1
1
  module WebrtcRails
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webrtc-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koji Murata
@@ -144,8 +144,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.4.5.1
147
+ rubygems_version: 2.4.5
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Simple Ruby on Rails WebRTC integration.
151
151
  test_files: []
152
+ has_rdoc: