vzaar 1.4.4 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: daaa5abc46d7d81600d16d5fef1cfee198ccd49c
4
- data.tar.gz: a4bf4aaf7e2d86a9229962b608f9d0326c2b3be6
3
+ metadata.gz: 486996c87c849996d434bbb52f2ad894f243b528
4
+ data.tar.gz: e3e1ca8593af8e1627b62228ac4ec1bc3fbb47fb
5
5
  SHA512:
6
- metadata.gz: e1abe62fae5216f2752484e8340f33bf42860292f38e349954040fd08fb9986c3a4e18ee930feb1e288ade058e7a465ec13a402c1eecf68f3101c989f04a38e4
7
- data.tar.gz: 7b7091697a815c4869a37a3709665dea6f2204b4528e2bdf5532e1a697d138c8270f39d8dee838644d825f4d886d3947c32b2e6a070fc61065eb236f0af9930d
6
+ metadata.gz: 5cf5f7a6a62ae932d7648f53be4eb68f6c97d674a70bbc6d47a406fd12343016273e61e52a9581f279124b2c0cdaaa64e786aa3cbaa884fa4d24e6a7385553ad
7
+ data.tar.gz: 551a3afd1e144fcab2f7cdf705983bac04c790625a3191936952cf25c6af9ebc2c1ac44e022dd89558d016bf7473160fb2756b39350be148649826947b3fb899
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ 2015-02-19 JC <jozef@vzaar.com>
2
+
3
+ * renditions added to Vzaar::Resource::Video
4
+
1
5
  2015-02-16 JC <jozef@vzaar.com>
2
6
 
3
7
  * private and seo_url params added to api#edit_video
@@ -1,6 +1,15 @@
1
1
  module Vzaar
2
2
  module Resource
3
3
  class Video < Base
4
+
5
+ class Rendition < Base
6
+ root_node "//rendition"
7
+
8
+ attribute :type
9
+ attribute :status
10
+ attribute :status_id, type: Integer
11
+ end
12
+
4
13
  root_node "//oembed"
5
14
 
6
15
  attribute :type
@@ -34,6 +43,12 @@ module Vzaar
34
43
  def error
35
44
  ""
36
45
  end
46
+
47
+ def renditions
48
+ @renditions ||= doc.at_xpath("//oembed/renditions").elements.map do |xml|
49
+ Rendition.new(xml.to_s, http_status_code)
50
+ end
51
+ end
37
52
  end
38
53
  end
39
54
  end
data/lib/vzaar/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vzaar
2
- VERSION = "1.4.4"
2
+ VERSION = "1.5.0"
3
3
  end
@@ -0,0 +1,23 @@
1
+ require "spec_helper"
2
+
3
+ describe Vzaar::Resource::Video do
4
+ let(:rendition_1_type) { "sd" }
5
+ let(:rendition_1_status) { "finished" }
6
+ let(:rendition_1_status_id) { 3 }
7
+
8
+ let(:xml) do
9
+ "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<oembed>\n <type>video</type>\n <version>1.0</version>\n <width>240</width>\n <height>244</height>\n <html>\n <![CDATA[<iframe allowFullScreen allowTransparency=\"true\" class=\"vzaar-video-player\" frameborder=\"0\" height=\"244\" id=\"vzvd-2762728\" mozallowfullscreen name=\"vzvd-2762728\" src=\"//view.vzaar.com/2762728/player\" title=\"vzaar video player\" type=\"text/html\" webkitAllowFullScreen width=\"240\"></iframe>]]>\n </html>\n <video_status_id>2</video_status_id>\n <video_status_description>Transcoded</video_status_description>\n <play_count>0</play_count>\n <total_size>882076</total_size>\n <title>v1-prod</title>\n <description>xx</description>\n <author_name>cfx</author_name>\n <author_url>http://app.vzaar.com/users/cfx</author_url>\n <author_account>34</author_account>\n <provider_name>vzaar</provider_name>\n <provider_url>http://vzaar.com</provider_url>\n <video_url>https://view.vzaar.com/2762728/video</video_url>\n <thumbnail_url>https://view.vzaar.com/2762728/thumb</thumbnail_url>\n <thumbnail_width>120</thumbnail_width>\n <thumbnail_height>90</thumbnail_height>\n <framegrab_url>https://view.vzaar.com/2762728/image</framegrab_url>\n <framegrab_width>240</framegrab_width>\n <framegrab_height>244</framegrab_height>\n <duration>5.0</duration>\n <renditions>\n <rendition>\n <type>#{rendition_1_type}</type>\n <status_id>#{rendition_1_status_id}</status_id>\n <status>#{rendition_1_status}</status>\n </rendition>\n <rendition>\n <type>hls</type>\n <status_id>3</status_id>\n <status>finished</status>\n </rendition>\n </renditions>\n</oembed>\n"
10
+ end
11
+
12
+ subject { described_class.new(xml) }
13
+
14
+ describe "renditions" do
15
+ before do
16
+ @rendition_1 = subject.renditions.first
17
+ end
18
+
19
+ specify { expect(@rendition_1.type).to eq(rendition_1_type) }
20
+ specify { expect(@rendition_1.status).to eq(rendition_1_status) }
21
+ specify { expect(@rendition_1.status_id).to eq(rendition_1_status_id) }
22
+ end
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vzaar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed James
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-16 00:00:00.000000000 Z
12
+ date: 2015-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -286,10 +286,11 @@ files:
286
286
  - spec/vzaar/api_xml_spec.rb
287
287
  - spec/vzaar/connection_spec.rb
288
288
  - spec/vzaar/request/base_spec.rb
289
- - spec/vzaar/request/process_video.rb
289
+ - spec/vzaar/request/process_video_spec.rb
290
290
  - spec/vzaar/request/url_spec.rb
291
291
  - spec/vzaar/resources/account_type_spec.rb
292
292
  - spec/vzaar/resources/signature_spec.rb
293
+ - spec/vzaar/resources/video_spec.rb
293
294
  - spec/vzaar/uploader_spec.rb
294
295
  - spec/vzaar_spec.rb
295
296
  - vzaar.gemspec
@@ -316,7 +317,7 @@ rubyforge_project:
316
317
  rubygems_version: 2.4.2
317
318
  signing_key:
318
319
  specification_version: 4
319
- summary: vzaar-1.4.4
320
+ summary: vzaar-1.5.0
320
321
  test_files:
321
322
  - spec/fixtures/vcr_cassettes/account_type-fail.yml
322
323
  - spec/fixtures/vcr_cassettes/account_type-success.yml
@@ -362,9 +363,10 @@ test_files:
362
363
  - spec/vzaar/api_xml_spec.rb
363
364
  - spec/vzaar/connection_spec.rb
364
365
  - spec/vzaar/request/base_spec.rb
365
- - spec/vzaar/request/process_video.rb
366
+ - spec/vzaar/request/process_video_spec.rb
366
367
  - spec/vzaar/request/url_spec.rb
367
368
  - spec/vzaar/resources/account_type_spec.rb
368
369
  - spec/vzaar/resources/signature_spec.rb
370
+ - spec/vzaar/resources/video_spec.rb
369
371
  - spec/vzaar/uploader_spec.rb
370
372
  - spec/vzaar_spec.rb