evostream-event 0.1.2 → 0.2.0.pre.22
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 +4 -4
- data/lib/evostream/event.rb +14 -1
- data/lib/evostream/event/commands.rb +1 -0
- data/lib/evostream/event/commands/push_stream.rb +36 -0
- data/lib/evostream/event/info.rb +3 -3
- metadata +9 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bda4544e052f192f291c65e4b6d322d68495b757
|
|
4
|
+
data.tar.gz: b800163b0795c5a1d213868f63e6fbe0dabba642
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 17eba235669fe35b255c18317626a0d99123a387b22d3b365d3589f9c775bd96ab2b4158c6f88ac327c44cda626ab11a979bbbaa641df4051eb3c09b6e4bcec3
|
|
7
|
+
data.tar.gz: bb879900c41c7329e2d00b77613bcf11660444e7176f68ec038921aa45bb4081925853181a8622f992c2b2a6f917a0d9900ccdc148a110bfa772e131683e74e8
|
data/lib/evostream/event.rb
CHANGED
|
@@ -21,7 +21,20 @@ module Evostream
|
|
|
21
21
|
Rails.logger.debug "[#{Evostream::GEM_NAME}] #{message}" if defined?(Rails)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
#
|
|
24
|
+
# Send an action to evostream server
|
|
25
|
+
class Action
|
|
26
|
+
def initialize(payload)
|
|
27
|
+
@payload = payload
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def execute_action(command_name)
|
|
31
|
+
cmd = command_name.sub(/^(\w)/, &:capitalize)
|
|
32
|
+
klass = "Evostream::Commands::#{cmd}".constantize
|
|
33
|
+
Evostream.send_command(klass.new(@payload))
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Reacts to event
|
|
25
38
|
class Event
|
|
26
39
|
EVENTS = Evostream::Events::Event.descendants
|
|
27
40
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Evostream
|
|
4
|
+
module Commands
|
|
5
|
+
# This will try to push a local stream to an external destination. The
|
|
6
|
+
# pushed stream can only use the RTMP, RTSP or MPEG-TS unicast/multicast
|
|
7
|
+
# protocol.
|
|
8
|
+
class PushStream < Command
|
|
9
|
+
def initialize(commands = {})
|
|
10
|
+
super(commands)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
private
|
|
14
|
+
|
|
15
|
+
attr_reader :command
|
|
16
|
+
|
|
17
|
+
# TheURI of the external stream. Can be RTMP, RTSP or unicast/multicast
|
|
18
|
+
# (d) mpegts
|
|
19
|
+
def uri(param = 'null')
|
|
20
|
+
"uri=#{param} "
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# If provided, the stream will be given this name. Otherwise, a fallback
|
|
24
|
+
# techniqueis used to determine the stream name (based on the URI)
|
|
25
|
+
def local_stream_name(param = '')
|
|
26
|
+
"localStreamName=#{param} "
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# The name of the stream at destination. If not provided, the target
|
|
30
|
+
# stream name willbe the same as the local stream name
|
|
31
|
+
def target_stream_name(param = 'null')
|
|
32
|
+
"targetStreamName=#{param} "
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
data/lib/evostream/event/info.rb
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Define constant to gem.
|
|
7
7
|
module Evostream
|
|
8
8
|
# Define version to gem
|
|
9
|
-
VERSION = '0.
|
|
9
|
+
VERSION = '0.2.0'
|
|
10
10
|
|
|
11
11
|
# Name to gem
|
|
12
12
|
GEM_NAME = 'evostream-event'
|
|
@@ -25,11 +25,11 @@ module Evostream
|
|
|
25
25
|
|
|
26
26
|
# Define a long description to gem
|
|
27
27
|
DESCRIPTION = <<-DESC
|
|
28
|
-
|
|
28
|
+
Manipulate event evostream and send actions to evostream server.
|
|
29
29
|
DESC
|
|
30
30
|
|
|
31
31
|
# Define homepage
|
|
32
|
-
HOMEPAGE = 'https://github.com/
|
|
32
|
+
HOMEPAGE = 'https://github.com/Dev-Crea/evostream-event'
|
|
33
33
|
|
|
34
34
|
# Define a post install message
|
|
35
35
|
POST_INSTALL = \
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: evostream-event
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0.pre.22
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- VAILLANT Jeremy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-03-
|
|
11
|
+
date: 2017-03-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -228,8 +228,8 @@ dependencies:
|
|
|
228
228
|
- - ">="
|
|
229
229
|
- !ruby/object:Gem::Version
|
|
230
230
|
version: 2.3.2
|
|
231
|
-
description: |
|
|
232
|
-
|
|
231
|
+
description: |2
|
|
232
|
+
Manipulate event evostream and send actions to evostream server.
|
|
233
233
|
email:
|
|
234
234
|
- jeremy@dazzl.tv
|
|
235
235
|
executables: []
|
|
@@ -246,6 +246,7 @@ files:
|
|
|
246
246
|
- lib/evostream/event/commands/create/dash.rb
|
|
247
247
|
- lib/evostream/event/commands/create/hls.rb
|
|
248
248
|
- lib/evostream/event/commands/destroy.rb
|
|
249
|
+
- lib/evostream/event/commands/push_stream.rb
|
|
249
250
|
- lib/evostream/event/events.rb
|
|
250
251
|
- lib/evostream/event/events/in_stream_closed.rb
|
|
251
252
|
- lib/evostream/event/events/in_stream_created.rb
|
|
@@ -265,14 +266,14 @@ files:
|
|
|
265
266
|
- spec/spec_helper.rb
|
|
266
267
|
- spec/support/examples_commands.rb
|
|
267
268
|
- spec/support/examples_events.rb
|
|
268
|
-
homepage: https://github.com/
|
|
269
|
+
homepage: https://github.com/Dev-Crea/evostream-event
|
|
269
270
|
licenses:
|
|
270
271
|
- MIT
|
|
271
272
|
metadata: {}
|
|
272
273
|
post_install_message: |-
|
|
273
274
|
# ====================================================== #
|
|
274
275
|
# Thanks for installing EvoStream-Event ! #
|
|
275
|
-
# https://github.com/
|
|
276
|
+
# https://github.com/Dev-Crea/evostream-event. #
|
|
276
277
|
# ;;;;;;;;;;;:. #
|
|
277
278
|
# ;;;;;;;;;;;;;;;;;; #
|
|
278
279
|
# ;;;;;;;;;;;:;;;;;;;; #
|
|
@@ -297,9 +298,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
297
298
|
version: '0'
|
|
298
299
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
299
300
|
requirements:
|
|
300
|
-
- - "
|
|
301
|
+
- - ">"
|
|
301
302
|
- !ruby/object:Gem::Version
|
|
302
|
-
version:
|
|
303
|
+
version: 1.3.1
|
|
303
304
|
requirements: []
|
|
304
305
|
rubyforge_project:
|
|
305
306
|
rubygems_version: 2.4.5
|