zencoder 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +30 -7
- data/lib/zencoder/version.rb +1 -1
- metadata +2 -2
data/README.markdown
CHANGED
@@ -37,6 +37,16 @@ A Zencoder::Response can be used as follows:
|
|
37
37
|
response.raw_body # => the body pre-JSON-parsing
|
38
38
|
response.raw_response # => the raw Net::HTTP or Typhoeus response (see below for how to use Typhoeus)
|
39
39
|
|
40
|
+
### Parameters
|
41
|
+
|
42
|
+
When sending API request parameters you can specify them as a non-string object, which we'll then serialize to JSON (by default):
|
43
|
+
|
44
|
+
Zencoder::Job.create({:input => 's3://bucket/key.mp4'})
|
45
|
+
|
46
|
+
Or you can specify them as a string, which we'll just pass along as the request body:
|
47
|
+
|
48
|
+
Zencoder::Job.create('{"input": "s3://bucket/key.mp4"}')
|
49
|
+
|
40
50
|
## Jobs
|
41
51
|
|
42
52
|
There's more you can do on jobs than anything else in the API. The following methods are available: `list`, `create`, `details`, `progress`, `resubmit`, `cancel`, `delete`.
|
@@ -157,9 +167,16 @@ See the HTTP backends in this library to get started on your own.
|
|
157
167
|
|
158
168
|
### Advanced Options
|
159
169
|
|
160
|
-
A secondary options hash can be passed to any method call which will then be passed on to the HTTP backend. You can pass `timeout` (in milliseconds), `headers`, and `params` (will be added to the query string) to any of the backends. If you are using Typhoeus, see their documentation for further options.
|
170
|
+
A secondary options hash can be passed to any method call which will then be passed on to the HTTP backend. You can pass `timeout` (in milliseconds), `headers`, and `params` (will be added to the query string) to any of the backends. If you are using Typhoeus, see their documentation for further options. In the following example the timeout is set to one second:
|
171
|
+
|
172
|
+
Zencoder::Job.create({:input => 's3://bucket/key.mp4'}, {:timeout => 1000})
|
161
173
|
|
162
|
-
|
174
|
+
|
175
|
+
### Format
|
176
|
+
|
177
|
+
By default we'll send and receive JSON for all our communication. If you would rather use XML then you can pass :format => :xml in the secondary options hash.
|
178
|
+
|
179
|
+
Zencoder::Job.create({:input => 's3://bucket/key.mp4'}, {:format => :xml})
|
163
180
|
|
164
181
|
### Default Options
|
165
182
|
|
@@ -171,14 +188,20 @@ Default options are passed to the HTTP backend. These can be retrieved and modif
|
|
171
188
|
|
172
189
|
### SSL
|
173
190
|
|
174
|
-
The Net::HTTP backend will do its best to locate your local SSL certs to allow SSL verification. For a list of paths that are checked, see `Zencoder::HTTP::NetHTTP.root_cert_paths`. Feel free to add your own at runtime.
|
191
|
+
The Net::HTTP backend will do its best to locate your local SSL certs to allow SSL verification. For a list of paths that are checked, see `Zencoder::HTTP::NetHTTP.root_cert_paths`. Feel free to add your own at runtime. Let us know if we're missing a common location.
|
175
192
|
|
176
193
|
Zencoder::HTTP::NetHTTP.root_cert_paths << '/my/custom/cert/path'
|
177
194
|
|
178
|
-
## Advanced JSON
|
195
|
+
## Advanced JSON and XML
|
196
|
+
|
197
|
+
### Alternate JSON and XML Libraries
|
198
|
+
|
199
|
+
This library uses the `activesupport` gem to encode and decode JSON. The latest versions of ActiveSupport allow you to change the libraries used to decode JSON and XML.
|
200
|
+
|
201
|
+
You can change the JSON decoding backend for ActiveSupport in Rails 2.3 like so:
|
179
202
|
|
180
|
-
|
203
|
+
ActiveSupport::JSON.backend = "JSONGem"
|
181
204
|
|
182
|
-
|
205
|
+
Or change the XML decoding backend for ActiveSupport in Rails 2.3 like so:
|
183
206
|
|
184
|
-
|
207
|
+
ActiveSupport::XmlMini.backend = "Nokogiri"
|
data/lib/zencoder/version.rb
CHANGED