vzaar 1.4.4 → 1.5.0
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.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/lib/vzaar/resources/video.rb +15 -0
- data/lib/vzaar/version.rb +1 -1
- data/spec/vzaar/request/{process_video.rb → process_video_spec.rb} +0 -0
- data/spec/vzaar/resources/video_spec.rb +23 -0
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 486996c87c849996d434bbb52f2ad894f243b528
|
4
|
+
data.tar.gz: e3e1ca8593af8e1627b62228ac4ec1bc3fbb47fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cf5f7a6a62ae932d7648f53be4eb68f6c97d674a70bbc6d47a406fd12343016273e61e52a9581f279124b2c0cdaaa64e786aa3cbaa884fa4d24e6a7385553ad
|
7
|
+
data.tar.gz: 551a3afd1e144fcab2f7cdf705983bac04c790625a3191936952cf25c6af9ebc2c1ac44e022dd89558d016bf7473160fb2756b39350be148649826947b3fb899
|
data/ChangeLog
CHANGED
@@ -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
File without changes
|
@@ -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
|
+
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-
|
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/
|
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.
|
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/
|
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
|