vzaar 0.2.2.2 → 0.2.3

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.
Files changed (3) hide show
  1. data/Changelog +4 -0
  2. data/lib/vzaar/base.rb +18 -4
  3. metadata +3 -4
data/Changelog CHANGED
@@ -1,3 +1,7 @@
1
+ 0.2.3
2
+
3
+ ADDED transcoding param to upload_video and process_video
4
+
1
5
  0.2.2.2
2
6
 
3
7
  ADDED play_count to video_details
data/lib/vzaar/base.rb CHANGED
@@ -225,7 +225,9 @@ module Vzaar
225
225
  # the upload_video method.
226
226
  #
227
227
  # Usage:
228
- # * vzaar.process_video :guid => signature.guid, :title => 'Some title', :description => 'Some description', :profile => 1
228
+ # * vzaar.process_video :guid => signature.guid,
229
+ # :title => 'Some title', :description => 'Some description',
230
+ # :profile => 1, :transcoding => true
229
231
  def process_video(options = {})
230
232
  request_xml = %{
231
233
  <?xml version="1.0" encoding="UTF-8"?>
@@ -235,17 +237,28 @@ module Vzaar
235
237
  <title>#{options[:title]}</title>
236
238
  <description>#{options[:description]}</description>
237
239
  <profile>#{options[:profile]}</profile>
240
+ }
241
+ if !options[:transcoding].nil?
242
+ request_xml += %{
243
+ <transcoding>#{options[:transcoding]}</transcoding>
244
+ }
245
+ end
246
+ request_xml += %{
238
247
  </video>
239
248
  </vzaar-api>
240
249
  }
241
250
  auth_connection HTTP_POST, '/api/videos', request_xml
242
251
  end
243
252
 
244
- # Uploads a video to vzaar.
253
+ # Uploads a video to vzaar. You can force transcoding video by setting
254
+ # transcoding param to true, you can force DNE (Do not encode) by
255
+ # setting transcoding param to false. When trancoding == nil (default)
256
+ # then user settings on vzaar will decide whether to encode or DNE.
245
257
  #
246
258
  # Usage:
247
259
  # * vzaar.upload_video '/home/me/video.mp4', 'some title', 'some desc', '1'
248
- def upload_video(path, title, description, profile)
260
+ # * vzaar.upload_video '/home/me/video.mp4', ""
261
+ def upload_video(path, title, description, profile, transcoding = nil)
249
262
  # Get signature
250
263
  sig = signature
251
264
  @logger.debug "Uploading..."
@@ -256,7 +269,8 @@ module Vzaar
256
269
  @logger.debug "Upload complete"
257
270
  # And process in vzaar
258
271
  process_video :guid => sig.guid, :title => title,
259
- :description => description, :profile => profile
272
+ :description => description, :profile => profile,
273
+ :transcoding => transcoding
260
274
  else
261
275
  @logger.debug "Upload to s3 failed"
262
276
  return nil
metadata CHANGED
@@ -5,9 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 2
9
- - 2
10
- version: 0.2.2.2
8
+ - 3
9
+ version: 0.2.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - Mariusz Lusiak
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-09-02 00:00:00 +02:00
17
+ date: 2011-02-04 00:00:00 +01:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency