brightcove-api 1.0.9 → 1.0.10
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.
- data/CHANELOG.markdown +4 -0
- data/README.md +5 -0
- data/VERSION +1 -1
- data/brightcove-api.gemspec +2 -2
- data/lib/brightcove-api.rb +13 -7
- data/test/test_brightcove-api.rb +1 -1
- metadata +3 -3
data/CHANELOG.markdown
CHANGED
data/README.md
CHANGED
|
@@ -50,6 +50,11 @@ If you want to perform a file upload, for example, to create a video, you can us
|
|
|
50
50
|
>> response = brightcove.post_file('create_video', '/path/to/video.mov', :video => {:shortDescription => 'Short Description', :name => 'Video name'})
|
|
51
51
|
=> {"result"=>653155417001, "error=>nil, "id"=>nil}
|
|
52
52
|
|
|
53
|
+
If you want to perform a file upload using HTTP streaming, for example, to create a video, you can use the __post_file_streaming()__ method.
|
|
54
|
+
|
|
55
|
+
>> response = brightcove.post_file_streaming('create_video', '/path/to/video.mov', 'video/quicktime', :video => {:shortDescription => 'Short Description', :name => 'Video name'})
|
|
56
|
+
=> {"result"=>653155417001, "error=>nil, "id"=>nil}
|
|
57
|
+
|
|
53
58
|
Note on Patches/Pull Requests
|
|
54
59
|
=============================
|
|
55
60
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.10
|
data/brightcove-api.gemspec
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{brightcove-api}
|
|
8
|
-
s.version = "1.0.
|
|
8
|
+
s.version = "1.0.10"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["David Czarnecki"]
|
|
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
|
|
|
36
36
|
s.homepage = %q{http://github.com/BrightcoveOS/Ruby-MAPI-Wrapper}
|
|
37
37
|
s.licenses = ["MIT"]
|
|
38
38
|
s.require_paths = ["lib"]
|
|
39
|
-
s.rubygems_version = %q{1.
|
|
39
|
+
s.rubygems_version = %q{1.6.2}
|
|
40
40
|
s.summary = %q{Ruby gem for interacting with the Brightcove media API}
|
|
41
41
|
s.test_files = [
|
|
42
42
|
"test/helper.rb",
|
data/lib/brightcove-api.rb
CHANGED
|
@@ -9,7 +9,7 @@ module Brightcove
|
|
|
9
9
|
include HTTParty
|
|
10
10
|
disable_rails_query_string_format
|
|
11
11
|
|
|
12
|
-
VERSION = '1.0.
|
|
12
|
+
VERSION = '1.0.10'.freeze
|
|
13
13
|
|
|
14
14
|
DEFAULT_HEADERS = {
|
|
15
15
|
'User-Agent' => "brightcove-api gem #{VERSION}"
|
|
@@ -120,15 +120,21 @@ module Brightcove
|
|
|
120
120
|
body.merge!({:method => api_method})
|
|
121
121
|
body.merge!({:params => parameters})
|
|
122
122
|
|
|
123
|
+
# Brightcove requires that the JSON-RPC call absolutely
|
|
124
|
+
# be the first part of a multi-part POST like create_video.
|
|
125
|
+
if RUBY_VERSION >= '1.9'
|
|
126
|
+
payload = {}
|
|
127
|
+
else
|
|
128
|
+
payload = OrderedHash.new
|
|
129
|
+
end
|
|
130
|
+
|
|
123
131
|
url = URI.parse(@write_api_url)
|
|
124
132
|
response = nil
|
|
125
133
|
File.open(upload_file) do |file|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
:file => UploadIO.new(file, content_type)
|
|
131
|
-
})
|
|
134
|
+
payload[:json] = body.to_json
|
|
135
|
+
payload[:file] = UploadIO.new(file, content_type)
|
|
136
|
+
|
|
137
|
+
request = Net::HTTP::Post::Multipart.new(url.path, payload)
|
|
132
138
|
|
|
133
139
|
response = Net::HTTP.start(url.host, url.port) do |http|
|
|
134
140
|
http.request(request)
|
data/test/test_brightcove-api.rb
CHANGED
metadata
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: brightcove-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease:
|
|
5
|
-
version: 1.0.
|
|
5
|
+
version: 1.0.10
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- David Czarnecki
|
|
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
140
140
|
requirements:
|
|
141
141
|
- - ">="
|
|
142
142
|
- !ruby/object:Gem::Version
|
|
143
|
-
hash:
|
|
143
|
+
hash: 3819893044315575553
|
|
144
144
|
segments:
|
|
145
145
|
- 0
|
|
146
146
|
version: "0"
|
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
153
153
|
requirements: []
|
|
154
154
|
|
|
155
155
|
rubyforge_project:
|
|
156
|
-
rubygems_version: 1.
|
|
156
|
+
rubygems_version: 1.6.2
|
|
157
157
|
signing_key:
|
|
158
158
|
specification_version: 3
|
|
159
159
|
summary: Ruby gem for interacting with the Brightcove media API
|