janus_gateway 0.0.10 → 0.0.11

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: 3efb7f20974406b25284ea454c139c0e06628fd7
4
- data.tar.gz: aea8862680a1ca5480b40f1aeac051da14b4a9a2
3
+ metadata.gz: 067890216107d717f768dd6f9923181309742b3e
4
+ data.tar.gz: e344e314528c46a579eb30923691bafc4dee89fc
5
5
  SHA512:
6
- metadata.gz: 0b664bcedb7a01197fb759b2063d98a28ebe482b84b90f61acabf8509b28ba9336d890e4efec1117fb0632eb1210f9dce98711af7cb16ea9c6e2097b1ae158f6
7
- data.tar.gz: fdce0287abdbcee990bd803de044823efb7e6ec7097b89e4ac0550775e4ef0363adc5a376e11d54bc1007ce71adb929c00e265ec9b240621b633acb94f017b8f
6
+ metadata.gz: 1d91ecd62373eab2276356a4d3eeecf7681543000e397e8fbe504723945157174e13054d02cd940ee9a500069f46f4977ff28f494ef69aff57cba0045cf0f0c8
7
+ data.tar.gz: e89743b139418a404bb624d17b404ab3757a3188ad35cc4c0b0946dd7df753e3fd8a0481441c7cc1849b3cddba198d4d98c797a2eeddefb8f868dabd83f44060
@@ -35,6 +35,41 @@ module JanusGateway::Plugin
35
35
  promise
36
36
  end
37
37
 
38
+ # @param [String] mountpoint_id
39
+ # @param [Array] streams
40
+ # @return [Concurrent::Promise]
41
+ def watch_udp(mountpoint_id, streams)
42
+ promise = Concurrent::Promise.new
43
+
44
+ client.send_transaction(
45
+ janus: 'message',
46
+ session_id: session.id,
47
+ handle_id: id,
48
+ body: {
49
+ request: 'watch-udp',
50
+ id: mountpoint_id,
51
+ streams: streams
52
+ }
53
+ ).then do |data|
54
+ plugindata = data['plugindata']['data']
55
+ if plugindata['error_code'].nil?
56
+ _on_success(data)
57
+
58
+ promise.set(data).execute
59
+ else
60
+ error = JanusGateway::Error.new(plugindata['error_code'], plugindata['error'])
61
+
62
+ _on_error(error)
63
+
64
+ promise.fail(error).execute
65
+ end
66
+ end.rescue do |error|
67
+ promise.fail(error).execute
68
+ end
69
+
70
+ promise
71
+ end
72
+
38
73
  private
39
74
 
40
75
  def _on_success(data)
@@ -20,12 +20,12 @@ module JanusGateway
20
20
 
21
21
  # @return [Concurrent::Promise]
22
22
  def create
23
- fail("`#{__method__}` is not implemented for `#{self.class.name}`")
23
+ raise("`#{__method__}` is not implemented for `#{self.class.name}`")
24
24
  end
25
25
 
26
26
  # @return [Concurrent::Promise]
27
27
  def destroy
28
- fail("`#{__method__}` is not implemented for `#{self.class.name}`")
28
+ raise("`#{__method__}` is not implemented for `#{self.class.name}`")
29
29
  end
30
30
  end
31
31
  end
@@ -3,31 +3,31 @@ module JanusGateway
3
3
  include Events::Emitter
4
4
 
5
5
  def run
6
- fail("`#{__method__}` is not implemented for `#{self.class.name}`")
6
+ raise("`#{__method__}` is not implemented for `#{self.class.name}`")
7
7
  end
8
8
 
9
9
  def connect
10
- fail("`#{__method__}` is not implemented for `#{self.class.name}`")
10
+ raise("`#{__method__}` is not implemented for `#{self.class.name}`")
11
11
  end
12
12
 
13
13
  def disconnect
14
- fail("`#{__method__}` is not implemented for `#{self.class.name}`")
14
+ raise("`#{__method__}` is not implemented for `#{self.class.name}`")
15
15
  end
16
16
 
17
17
  # @param [Hash] data
18
18
  def send(_data)
19
- fail("`#{__method__}` is not implemented for `#{self.class.name}`")
19
+ raise("`#{__method__}` is not implemented for `#{self.class.name}`")
20
20
  end
21
21
 
22
22
  # @param [Hash] data
23
23
  # @return [Concurrent::Promise]
24
24
  def send_transaction(_data)
25
- fail("`#{__method__}` is not implemented for `#{self.class.name}`")
25
+ raise("`#{__method__}` is not implemented for `#{self.class.name}`")
26
26
  end
27
27
 
28
28
  # @return [TrueClass, FalseClass]
29
29
  def connected?
30
- fail("`#{__method__}` is not implemented for `#{self.class.name}`")
30
+ raise("`#{__method__}` is not implemented for `#{self.class.name}`")
31
31
  end
32
32
 
33
33
  # @return [String]
@@ -13,7 +13,7 @@ module JanusGateway
13
13
 
14
14
  def run
15
15
  EventMachine.run do
16
- EM.error_handler { |e| fail(e) }
16
+ EM.error_handler { |e| raise(e) }
17
17
  # will be used for long-pooling. currently does nothing
18
18
  end
19
19
  end
@@ -16,13 +16,13 @@ module JanusGateway
16
16
 
17
17
  def run
18
18
  EventMachine.run do
19
- EM.error_handler { |e| fail(e) }
19
+ EM.error_handler { |e| raise(e) }
20
20
  connect
21
21
  end
22
22
  end
23
23
 
24
24
  def connect
25
- fail('WebSocket client already exists!') unless @client.nil?
25
+ raise('WebSocket client already exists!') unless @client.nil?
26
26
 
27
27
  @client = _create_client(@url, @protocol)
28
28
 
@@ -1,3 +1,3 @@
1
1
  module JanusGateway
2
- VERSION = '0.0.10'.freeze
2
+ VERSION = '0.0.11'.freeze
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.10
4
+ version: 0.0.11
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: 2016-01-21 00:00:00.000000000 Z
14
+ date: 2016-03-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faye-websocket
@@ -87,16 +87,16 @@ dependencies:
87
87
  name: rake
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - ">="
90
+ - - "~>"
91
91
  - !ruby/object:Gem::Version
92
- version: '0'
92
+ version: 10.5.0
93
93
  type: :development
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ">="
97
+ - - "~>"
98
98
  - !ruby/object:Gem::Version
99
- version: '0'
99
+ version: 10.5.0
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: rspec
102
102
  requirement: !ruby/object:Gem::Requirement