bitmovin-ruby 0.5.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +1 -1
- data/lib/bitmovin/encoding/encodings/muxings/drms/drm_muxing_resource.rb +1 -1
- data/lib/bitmovin/encoding/encodings/muxings/mp4_muxing.rb +1 -0
- data/lib/bitmovin/encoding/encodings/muxings/muxing_resource.rb +1 -1
- data/lib/bitmovin/encoding/encodings/sprites/sprite.rb +1 -1
- data/lib/bitmovin/encoding/encodings/stream.rb +4 -2
- data/lib/bitmovin/encoding/encodings/thumbnails/thumbnail.rb +1 -1
- data/lib/bitmovin/encoding/manifests/audio_adaptation_set.rb +1 -2
- data/lib/bitmovin/encoding/manifests/fmp4_representation.rb +1 -2
- data/lib/bitmovin/encoding/manifests/hls_audio_media.rb +1 -1
- data/lib/bitmovin/encoding/manifests/hls_variant_stream.rb +1 -1
- data/lib/bitmovin/encoding/manifests/hls_variant_stream_list.rb +1 -2
- data/lib/bitmovin/encoding/manifests/manifest_resource.rb +1 -1
- data/lib/bitmovin/encoding/manifests/period.rb +1 -1
- data/lib/bitmovin/encoding/manifests/video_adaptation_set.rb +1 -2
- data/lib/bitmovin/helpers.rb +5 -1
- data/lib/bitmovin/resource.rb +13 -3
- data/lib/bitmovin/version.rb +1 -1
- data/lib/bitmovin/webhooks/encoding_error_webhook.rb +1 -1
- data/lib/bitmovin/webhooks/encoding_finished_webhook.rb +1 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 53be8773c2676dd4ec0932820209a81a31eac53a3d6024f62f70f0c6a8d895e6
|
4
|
+
data.tar.gz: 4436bd7136c442cc712dc08edcaeee7481fbe43a7bcc7af66a9b8963a82a32e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5c0ba7d9bdeff8ddd069b258fc52ad426a9abe51bc32feab03c5eac512c69cc19d8241be03cb253aa7288170e121394fdb2042e040d6f2585fb58d8e1a0af7b
|
7
|
+
data.tar.gz: d817d3d2f211f98fb7957723cbea72f10dbd01500cfea7613cdc8f43896bb19aa0c397d92a1d2ed766932f0914b09c22aabad2aa43a11b63d0ca9be8d3d76428
|
data/Gemfile.lock
CHANGED
@@ -11,7 +11,7 @@ module Bitmovin::Encoding::Encodings::Muxings::Drms
|
|
11
11
|
@muxing_id = muxing_id
|
12
12
|
muxing_type = self.class.name.demodulize.gsub(/(.*)Muxing.*/, '\1').downcase
|
13
13
|
encryption_type = self.class.name.demodulize.gsub(/.*Muxing(.*)Encryption/, '\1').downcase
|
14
|
-
|
14
|
+
init_instance(File.join("/v1/encoding/encodings/", encoding_id, "muxings", muxing_type, muxing_id, "drm", encryption_type))
|
15
15
|
super(hsh)
|
16
16
|
@outputs = (hsh[:outputs] || []).map do |output|
|
17
17
|
Bitmovin::Encoding::StreamOutput.new(output)
|
@@ -8,7 +8,7 @@ module Bitmovin::Encoding::Encodings::Muxings
|
|
8
8
|
hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
|
9
9
|
@encoding_id = encoding_id
|
10
10
|
muxing_type = self.class.name.demodulize.gsub(/(.*)Muxing/, '\1').downcase
|
11
|
-
|
11
|
+
init_instance(File.join("/v1/encoding/encodings/", encoding_id, "muxings", muxing_type))
|
12
12
|
super(hsh)
|
13
13
|
@outputs = (hsh[:outputs] || []).map do |output|
|
14
14
|
Bitmovin::Encoding::StreamOutput.new(output)
|
@@ -3,7 +3,7 @@ module Bitmovin::Encoding::Encodings
|
|
3
3
|
|
4
4
|
def initialize(encoding_id, stream_id, hash = {})
|
5
5
|
@errors = []
|
6
|
-
|
6
|
+
init_instance(File.join('/v1/encoding/encodings', encoding_id, 'streams', stream_id, 'sprites'))
|
7
7
|
|
8
8
|
@encoding_id = encoding_id
|
9
9
|
@stream_id = stream_id
|
@@ -3,18 +3,20 @@ module Bitmovin::Encoding::Encodings
|
|
3
3
|
attr_accessor :encoding_id
|
4
4
|
attr_accessor :id
|
5
5
|
attr_accessor :conditions
|
6
|
+
attr_accessor :mode
|
6
7
|
|
7
8
|
def initialize(encoding_id, hash = {})
|
8
9
|
set_defaults
|
9
10
|
hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
|
10
11
|
@encoding_id = encoding_id
|
11
|
-
|
12
|
+
init_instance(File.join("/v1/encoding/encodings/", encoding_id, "streams"))
|
12
13
|
super(hash)
|
13
14
|
@outputs = (hsh[:outputs] || []).map { |output| Bitmovin::Encoding::StreamOutput.new(output) }
|
14
15
|
@input_streams = (hsh[:input_streams] || []).map { |input| StreamInput.new(@encoding_id, @id, input) }
|
15
16
|
|
16
17
|
@errors = []
|
17
18
|
@conditions = nil
|
19
|
+
@mode = "STANDARD"
|
18
20
|
end
|
19
21
|
|
20
22
|
attr_accessor :name, :description, :created_at, :modified_at, :create_quality_meta_data
|
@@ -85,7 +87,7 @@ module Bitmovin::Encoding::Encodings
|
|
85
87
|
def collect_attributes
|
86
88
|
val = Hash.new
|
87
89
|
[:name, :description, :create_quality_meta_data,
|
88
|
-
:input_streams, :outputs, :codec_config_id, :conditions].each do |name|
|
90
|
+
:input_streams, :outputs, :codec_config_id, :conditions, :mode].each do |name|
|
89
91
|
json_name = ActiveSupport::Inflector.camelize(name.to_s, false)
|
90
92
|
val[json_name] = instance_variable_get("@#{name}")
|
91
93
|
end
|
@@ -3,7 +3,7 @@ module Bitmovin::Encoding::Encodings
|
|
3
3
|
|
4
4
|
def initialize(encoding_id, stream_id, hash = {})
|
5
5
|
@errors = []
|
6
|
-
|
6
|
+
init_instance(File.join('/v1/encoding/encodings', encoding_id, 'streams', stream_id, 'thumbnails'))
|
7
7
|
|
8
8
|
@encoding_id = encoding_id
|
9
9
|
@stream_id = stream_id
|
@@ -2,8 +2,7 @@ module Bitmovin::Encoding::Manifests
|
|
2
2
|
class AudioAdaptationSet < Bitmovin::Resource
|
3
3
|
include Bitmovin::ChildCollection
|
4
4
|
def initialize(manifest_id, period_id, hash = {})
|
5
|
-
|
6
|
-
self.class.init(path)
|
5
|
+
init_instance(File.join("/v1/encoding/manifests/dash/", manifest_id, "periods", period_id, "adaptationsets/audio"))
|
7
6
|
@manifest_id = manifest_id
|
8
7
|
@period_id = period_id
|
9
8
|
end
|
@@ -1,8 +1,7 @@
|
|
1
1
|
module Bitmovin::Encoding::Manifests
|
2
2
|
class Fmp4Representation < Bitmovin::Resource
|
3
3
|
def initialize(manifest_id, period_id, adaptationset_id, hash = {})
|
4
|
-
|
5
|
-
self.class.init(path)
|
4
|
+
init_instance(File.join("/v1/encoding/manifests/dash/", manifest_id, "periods", period_id, "adaptationsets/", adaptationset_id, "representations/fmp4"))
|
6
5
|
super(hash)
|
7
6
|
@manifest_id = manifest_id
|
8
7
|
@period_id = period_id
|
@@ -20,7 +20,7 @@ module Bitmovin::Encoding::Manifests
|
|
20
20
|
def initialize(manifest_id, hash = {})
|
21
21
|
hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
|
22
22
|
@manifest_id = manifest_id
|
23
|
-
|
23
|
+
init_instance(File.join("/v1/encoding/manifests/hls/", manifest_id, "media/audio"))
|
24
24
|
super(hsh)
|
25
25
|
end
|
26
26
|
|
@@ -13,7 +13,7 @@ module Bitmovin::Encoding::Manifests
|
|
13
13
|
def initialize(manifest_id, hash = {})
|
14
14
|
hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
|
15
15
|
@manifest_id = manifest_id
|
16
|
-
|
16
|
+
init_instance(File.join("/v1/encoding/manifests/hls/", manifest_id, "streams"))
|
17
17
|
super(hsh)
|
18
18
|
end
|
19
19
|
end
|
@@ -1,11 +1,10 @@
|
|
1
1
|
module Bitmovin::Encoding::Manifests
|
2
2
|
class HlsVariantStreamList < Bitmovin::Resource
|
3
|
-
init "streams"
|
4
3
|
attr_accessor :manifest_id
|
5
4
|
|
6
5
|
def initialize(manifest_id)
|
7
6
|
@manifest_id = manifest_id
|
8
|
-
|
7
|
+
init_instance(File.join("/v1/encoding/manifests/", manifest_id, "streams"))
|
9
8
|
#super(hsh)
|
10
9
|
end
|
11
10
|
|
@@ -3,7 +3,7 @@ module Bitmovin::Encoding::Manifests
|
|
3
3
|
def initialize(hash = {})
|
4
4
|
hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash))
|
5
5
|
muxing_type = self.class.name.demodulize.gsub(/(.*)Muxing/, '\1').downcase
|
6
|
-
|
6
|
+
init_instance(File.join("/v1/encoding/manifests/", encoding_id, "muxings", muxing_type))
|
7
7
|
super(hsh)
|
8
8
|
@outputs = (hsh[:outputs] || []).map do |output|
|
9
9
|
Bitmovin::Encoding::Encodings::StreamOutput.new(encoding_id, @id, output)
|
@@ -3,7 +3,7 @@ module Bitmovin::Encoding::Manifests
|
|
3
3
|
include Bitmovin::ChildCollection
|
4
4
|
|
5
5
|
def initialize(manifest_id, hash = {})
|
6
|
-
|
6
|
+
init_instance(File.join("/v1/encoding/manifests/dash/", manifest_id, "periods"))
|
7
7
|
@manifest_id = manifest_id
|
8
8
|
super(hash)
|
9
9
|
@video_adaptationsets = nil
|
@@ -2,8 +2,7 @@ module Bitmovin::Encoding::Manifests
|
|
2
2
|
class VideoAdaptationSet < Bitmovin::Resource
|
3
3
|
include Bitmovin::ChildCollection
|
4
4
|
def initialize(manifest_id, period_id, hash = {})
|
5
|
-
|
6
|
-
self.class.init(path)
|
5
|
+
init_instance(File.join("/v1/encoding/manifests/dash/", manifest_id, "periods", period_id, "adaptationsets/video"))
|
7
6
|
super(hash)
|
8
7
|
@manifest_id = manifest_id
|
9
8
|
@period_id = period_id
|
data/lib/bitmovin/helpers.rb
CHANGED
@@ -10,7 +10,11 @@ module Bitmovin::Helpers
|
|
10
10
|
def camelize_hash(hash)
|
11
11
|
ret = Hash.new
|
12
12
|
hash.each do |key, value|
|
13
|
-
|
13
|
+
if value.is_a?(Hash)
|
14
|
+
ret[ActiveSupport::Inflector.camelize(key, false)] = camelize_hash(value)
|
15
|
+
else
|
16
|
+
ret[ActiveSupport::Inflector.camelize(key, false)] = value
|
17
|
+
end
|
14
18
|
end
|
15
19
|
ret
|
16
20
|
end
|
data/lib/bitmovin/resource.rb
CHANGED
@@ -8,7 +8,6 @@ module Bitmovin
|
|
8
8
|
end
|
9
9
|
attr_reader :resource_path
|
10
10
|
|
11
|
-
|
12
11
|
def list(limit = 100, offset = 0)
|
13
12
|
response = Bitmovin.client.get @resource_path, limit: limit, offset: offset
|
14
13
|
Bitmovin::Helpers.result(response)['items'].map do |item|
|
@@ -22,6 +21,10 @@ module Bitmovin
|
|
22
21
|
end
|
23
22
|
end
|
24
23
|
|
24
|
+
def init_instance(path)
|
25
|
+
@instance_resource_path = path
|
26
|
+
end
|
27
|
+
|
25
28
|
attr_accessor :id, :name, :description, :created_at, :modified_at
|
26
29
|
|
27
30
|
|
@@ -35,7 +38,7 @@ module Bitmovin
|
|
35
38
|
end
|
36
39
|
|
37
40
|
response = Bitmovin.client.post do |post|
|
38
|
-
post.url
|
41
|
+
post.url resource_path
|
39
42
|
post.body = collect_attributes
|
40
43
|
end
|
41
44
|
yield(response.body) if block_given?
|
@@ -48,7 +51,7 @@ module Bitmovin
|
|
48
51
|
end
|
49
52
|
|
50
53
|
def delete!
|
51
|
-
Bitmovin.client.delete File.join(
|
54
|
+
Bitmovin.client.delete File.join(resource_path, @id)
|
52
55
|
end
|
53
56
|
|
54
57
|
def inspect
|
@@ -57,6 +60,10 @@ module Bitmovin
|
|
57
60
|
|
58
61
|
private
|
59
62
|
|
63
|
+
def resource_path
|
64
|
+
@instance_resource_path || self.class.resource_path
|
65
|
+
end
|
66
|
+
|
60
67
|
def init_from_hash(hash = {})
|
61
68
|
hash.each do |name, value|
|
62
69
|
instance_variable_set("@#{ActiveSupport::Inflector.underscore(name)}", value)
|
@@ -69,10 +76,13 @@ module Bitmovin
|
|
69
76
|
if (self.respond_to?(:ignore_fields))
|
70
77
|
ignored_variables = self.ignore_fields
|
71
78
|
end
|
79
|
+
ignored_variables.push(:@instance_resource_path)
|
80
|
+
|
72
81
|
instance_variables.each do |name|
|
73
82
|
if ignored_variables.include?(name)
|
74
83
|
next
|
75
84
|
end
|
85
|
+
|
76
86
|
if name == :@max_ctu_size
|
77
87
|
val['maxCTUSize'] = instance_variable_get(name)
|
78
88
|
else
|
data/lib/bitmovin/version.rb
CHANGED
@@ -4,7 +4,7 @@ module Bitmovin::Webhooks
|
|
4
4
|
def initialize(encoding_id, hash = {})
|
5
5
|
if encoding_id.kind_of?(String)
|
6
6
|
@encoding_id = encoding_id
|
7
|
-
|
7
|
+
init_instance("notifications/webhooks/encoding/encodings/#{encoding_id}/error")
|
8
8
|
else
|
9
9
|
hash = encoding_id
|
10
10
|
end
|
@@ -4,7 +4,7 @@ module Bitmovin::Webhooks
|
|
4
4
|
def initialize(encoding_id = {}, hash = {})
|
5
5
|
if encoding_id.kind_of?(String)
|
6
6
|
@encoding_id = encoding_id
|
7
|
-
|
7
|
+
init_instance("notifications/webhooks/encoding/encodings/#{encoding_id}/finished")
|
8
8
|
else
|
9
9
|
hash = encoding_id
|
10
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitmovin-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Hoelbling-Inzko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -28,20 +28,20 @@ dependencies:
|
|
28
28
|
name: httpclient
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.8.3
|
34
|
-
- - "
|
34
|
+
- - "~>"
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: 2.8.3
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- - "
|
41
|
+
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: 2.8.3
|
44
|
-
- - "
|
44
|
+
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.8.3
|
47
47
|
- !ruby/object:Gem::Dependency
|
@@ -227,8 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
227
227
|
- !ruby/object:Gem::Version
|
228
228
|
version: '0'
|
229
229
|
requirements: []
|
230
|
-
|
231
|
-
rubygems_version: 2.6.11
|
230
|
+
rubygems_version: 3.0.1
|
232
231
|
signing_key:
|
233
232
|
specification_version: 4
|
234
233
|
summary: Api Client for the Bitmovin API
|