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: fce95cd96c95938e04f2bfedfbbcd48468e094b9
4
- data.tar.gz: f0c7dae8907a4dfddf7a98eecc9528056fd19971
3
+ metadata.gz: a505d780da55dec4b0015c3c39c9e0050bbbaff2
4
+ data.tar.gz: 61dcbf0f351f1874adf838d88654d9644e4eb93f
5
5
  SHA512:
6
- metadata.gz: e29e73777a93e37f5d6deacc75c94757a433b37cfa9046d379fa3fbf441f574893e761c58f9a9d5753ba517df084edef1ecbd9a40e59b3e5f2f18dd8c53d8a1e
7
- data.tar.gz: fd2a44196ef4f92892360a88cfcd1625dba18209330ea5d3d78c401fc392ff4ab4a66f5c00f02e1470af88bb36f6b59f6770c21e7d9d6d5cd5cbe2a09530dca2
6
+ metadata.gz: 662f22ce21939dc74b9bd37b9183ad375b30839ff423b66c56a81c25acaf3daa1859538f86684748a653bdbd632732275c0573d1af3c5bc7fe58a8d6a2e12f64
7
+ data.tar.gz: 31511cfbb51a84824a049f1c7a532f0402c1932a4166c80c8c83d519d8ae4d279d700f80bc40884695fa3b4dcc24dd2e5edd2e8058ca94f909567f73cbd8df63
@@ -5,8 +5,13 @@ module JanusGateway
5
5
  attr_accessor :transport
6
6
 
7
7
  # @param [JanusGateway::Transport]
8
- def initialize(transport)
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
- @transport.send_transaction(data)
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
- def initialize(client, plugin, id, streams = nil)
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
@@ -1,3 +1,3 @@
1
1
  module JanusGateway
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  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
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-26 00:00:00.000000000 Z
14
+ date: 2015-11-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faye-websocket