janus_gateway 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a505d780da55dec4b0015c3c39c9e0050bbbaff2
|
4
|
+
data.tar.gz: 61dcbf0f351f1874adf838d88654d9644e4eb93f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 662f22ce21939dc74b9bd37b9183ad375b30839ff423b66c56a81c25acaf3daa1859538f86684748a653bdbd632732275c0573d1af3c5bc7fe58a8d6a2e12f64
|
7
|
+
data.tar.gz: 31511cfbb51a84824a049f1c7a532f0402c1932a4166c80c8c83d519d8ae4d279d700f80bc40884695fa3b4dcc24dd2e5edd2e8058ca94f909567f73cbd8df63
|
data/lib/janus_gateway/client.rb
CHANGED
@@ -5,8 +5,13 @@ module JanusGateway
|
|
5
5
|
attr_accessor :transport
|
6
6
|
|
7
7
|
# @param [JanusGateway::Transport]
|
8
|
-
|
8
|
+
# @param [Hash] options
|
9
|
+
def initialize(transport, options = {})
|
9
10
|
@transport = transport
|
11
|
+
@options = {
|
12
|
+
:token => nil,
|
13
|
+
:admin_secret => nil
|
14
|
+
}.merge(options)
|
10
15
|
end
|
11
16
|
|
12
17
|
def run
|
@@ -24,7 +29,8 @@ module JanusGateway
|
|
24
29
|
# @param [Hash] data
|
25
30
|
# @return [Concurrent::Promise]
|
26
31
|
def send_transaction(data)
|
27
|
-
@
|
32
|
+
extra_fields = @options.delete_if { |k, v| v.nil? }
|
33
|
+
@transport.send_transaction(data.merge(extra_fields))
|
28
34
|
end
|
29
35
|
|
30
36
|
# @return [TrueClass, FalseClass]
|
@@ -6,9 +6,11 @@ module JanusGateway::Plugin
|
|
6
6
|
# @param [JanusGateway::Plugin::Rtpbroadcast] plugin
|
7
7
|
# @param [String] id
|
8
8
|
# @param [Array] streams
|
9
|
-
|
9
|
+
# @param [String] channel_data
|
10
|
+
def initialize(client, plugin, id, streams = nil, channel_data = nil)
|
10
11
|
@plugin = plugin
|
11
12
|
@data = nil
|
13
|
+
@channel_data = channel_data
|
12
14
|
|
13
15
|
@streams = streams || [
|
14
16
|
{
|
@@ -39,7 +41,8 @@ module JanusGateway::Plugin
|
|
39
41
|
:name => id,
|
40
42
|
:description => id,
|
41
43
|
:recorded => true,
|
42
|
-
:streams => @streams
|
44
|
+
:streams => @streams,
|
45
|
+
:channel_data => @channel_data
|
43
46
|
}
|
44
47
|
}
|
45
48
|
).then do |data|
|
@@ -79,11 +79,10 @@ module JanusGateway
|
|
79
79
|
sleep(_transaction_timeout)
|
80
80
|
error = JanusGateway::Error.new(0, "Transaction id `#{transaction}` has failed due to timeout!")
|
81
81
|
promise.fail(error).execute
|
82
|
-
@transaction_queue.remove(transaction)
|
83
82
|
end
|
84
83
|
|
85
|
-
promise.then { thread.exit }
|
86
|
-
promise.rescue { thread.exit }
|
84
|
+
promise.then { @transaction_queue.remove(transaction); thread.exit }
|
85
|
+
promise.rescue { @transaction_queue.remove(transaction); thread.exit }
|
87
86
|
|
88
87
|
promise
|
89
88
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: janus_gateway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cargo Media
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-11-
|
14
|
+
date: 2015-11-27 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faye-websocket
|