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 +4 -4
- data/lib/janus_gateway/plugin/rtpbroadcast.rb +35 -0
- data/lib/janus_gateway/resource.rb +2 -2
- data/lib/janus_gateway/transport.rb +6 -6
- data/lib/janus_gateway/transport/http.rb +1 -1
- data/lib/janus_gateway/transport/websocket.rb +2 -2
- data/lib/janus_gateway/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 067890216107d717f768dd6f9923181309742b3e
|
4
|
+
data.tar.gz: e344e314528c46a579eb30923691bafc4dee89fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
-
|
6
|
+
raise("`#{__method__}` is not implemented for `#{self.class.name}`")
|
7
7
|
end
|
8
8
|
|
9
9
|
def connect
|
10
|
-
|
10
|
+
raise("`#{__method__}` is not implemented for `#{self.class.name}`")
|
11
11
|
end
|
12
12
|
|
13
13
|
def disconnect
|
14
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
30
|
+
raise("`#{__method__}` is not implemented for `#{self.class.name}`")
|
31
31
|
end
|
32
32
|
|
33
33
|
# @return [String]
|
@@ -16,13 +16,13 @@ module JanusGateway
|
|
16
16
|
|
17
17
|
def run
|
18
18
|
EventMachine.run do
|
19
|
-
EM.error_handler { |e|
|
19
|
+
EM.error_handler { |e| raise(e) }
|
20
20
|
connect
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
def connect
|
25
|
-
|
25
|
+
raise('WebSocket client already exists!') unless @client.nil?
|
26
26
|
|
27
27
|
@client = _create_client(@url, @protocol)
|
28
28
|
|
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.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-
|
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:
|
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:
|
99
|
+
version: 10.5.0
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
101
|
name: rspec
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|