vhx-ruby 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/vhx.rb +4 -3
- data/lib/vhx/client.rb +6 -3
- data/lib/vhx/objects/analytics.rb +9 -0
- data/lib/vhx/utilities/vhx_object.rb +2 -2
- data/lib/vhx/version.rb +2 -2
- data/spec/client_spec.rb +44 -9
- data/spec/fixtures/sample_authorization_response.json +19 -0
- data/spec/fixtures/sample_collection_response.json +20 -0
- data/spec/fixtures/sample_collections_response.json +14 -0
- data/spec/fixtures/sample_create_video_response.json +33 -0
- data/spec/fixtures/sample_customer_response.json +16 -0
- data/spec/fixtures/sample_customers_response.json +28 -0
- data/spec/fixtures/sample_files_response.json +16 -0
- data/spec/fixtures/sample_product_response.json +30 -0
- data/spec/fixtures/sample_products_response.json +14 -0
- data/spec/fixtures/sample_video_response.json +47 -31
- data/spec/fixtures/sample_videos_response.json +14 -0
- data/spec/middleware/error_response_spec.rb +3 -7
- data/spec/middleware/oauth2_spec.rb +3 -7
- data/spec/objects/analytics_spec.rb +41 -0
- data/spec/objects/authorization_spec.rb +58 -0
- data/spec/objects/collection_item_spec.rb +53 -0
- data/spec/objects/collection_spec.rb +66 -0
- data/spec/objects/customer_spec.rb +82 -0
- data/spec/objects/product_spec.rb +65 -0
- data/spec/objects/site_spec.rb +36 -27
- data/spec/objects/user_spec.rb +40 -32
- data/spec/objects/video_file_spec.rb +52 -0
- data/spec/objects/video_spec.rb +67 -23
- data/spec/spec_helper.rb +2 -11
- data/spec/utilities/vhx_helper_spec.rb +11 -7
- data/spec/utilities/vhx_list_object_spec.rb +27 -0
- data/spec/utilities/vhx_object_spec.rb +69 -26
- data/vhx.gemspec +4 -4
- metadata +59 -66
- data/spec/fixtures/sample_package_response.json +0 -185
- data/spec/objects/file_spec.rb +0 -29
- data/spec/objects/package_spec.rb +0 -74
- data/spec/test_data.rb +0 -55
- data/spec/utilities/vhx_collection_spec.rb +0 -27
- data/spec/vcr/Vhx_Client/application_user/_refresh_access_token/access_token_changed.yml +0 -57
- data/spec/vcr/Vhx_Client/application_user/_refresh_access_token/oauth_token_refreshed.yml +0 -57
- data/spec/vcr/Vhx_File/associations/are_present.yml +0 -409
- data/spec/vcr/Vhx_Middleware_ErrorResponse/unauthorized_user_credentials.yml +0 -122
- data/spec/vcr/Vhx_Middleware_OAuth2/access_token_refresh.yml +0 -797
- data/spec/vcr/Vhx_Package/_add_video/with_hypermedia/returns_package_object.yml +0 -51
- data/spec/vcr/Vhx_Package/_add_video/with_id/returns_package_object.yml +0 -51
- data/spec/vcr/Vhx_Package/_create/returns_package_object.yml +0 -140
- data/spec/vcr/Vhx_Package/_find/with_hypermedia.yml +0 -243
- data/spec/vcr/Vhx_Package/_find/with_id.yml +0 -243
- data/spec/vcr/Vhx_Package/_remove_video/with_hypermedia/returns_success.yml +0 -51
- data/spec/vcr/Vhx_Package/_remove_video/with_id/returns_success.yml +0 -51
- data/spec/vcr/Vhx_Package/associations/are_present.yml +0 -195
- data/spec/vcr/Vhx_Site/_create/returns_site_object.yml +0 -91
- data/spec/vcr/Vhx_Site/_find/with_hypermedia.yml +0 -195
- data/spec/vcr/Vhx_Site/_find/with_id.yml +0 -195
- data/spec/vcr/Vhx_User/_find/with_hypermedia.yml +0 -81
- data/spec/vcr/Vhx_User/_find/with_id.yml +0 -81
- data/spec/vcr/Vhx_User/_me/returns_user_object.yml +0 -720
- data/spec/vcr/Vhx_User/_update/returns_user_object.yml +0 -212
- data/spec/vcr/Vhx_VhxObject/associations/cache/retreive_if_available.yml +0 -195
- data/spec/vcr/Vhx_VhxObject/associations/falls_back_to_links.yml +0 -310
- data/spec/vcr/Vhx_Video/_create/returns_video_object.yml +0 -125
- data/spec/vcr/Vhx_Video/associations/are_present.yml +0 -294
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 134b9c8e24549b65fe6d38d553c0d786ab86cd55
|
4
|
+
data.tar.gz: 608cef9093c267377aa41769e5fd47233f9530a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6095076d2b38e520bccc62395f64ca787c3b4c32f8a829fbc9e9bd8b393c7d176bae1d6b948abfcbf42db3630f7c824dc9b156481314c782f2fafe364ab31e7
|
7
|
+
data.tar.gz: f771ba677ea096b041cc86f251d8b4584e61a7487a3de372c86228b96537db1dd7a39b1c45200e618aef620c5ba4a091e531c1fad66abbdc02713120df88b955
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@ Before requesting your first resource, you must setup an instance of the Vhx Cli
|
|
19
19
|
vhx = Vhx.setup({ api_key: 'your VHX API key'} )
|
20
20
|
```
|
21
21
|
|
22
|
-
Here's an example of creating a Vhx resource with payload options. You can handle errors by rescuing Vhx::VhxError.
|
22
|
+
Here's an example of creating a Vhx resource with payload options. You can handle errors by rescuing Vhx::VhxError.
|
23
23
|
|
24
24
|
```ruby
|
25
25
|
begin
|
@@ -57,3 +57,6 @@ collections
|
|
57
57
|
* [`retrieve`](http://dev.vhx.tv/docs/api?ruby#retrieve_collection)
|
58
58
|
* [`list`](http://dev.vhx.tv/docs/api?ruby#list_collections)
|
59
59
|
* [`items`](http://dev.vhx.tv/docs/api?ruby#list_collection_items)
|
60
|
+
|
61
|
+
analytics
|
62
|
+
* [`report`](http://dev.vhx.tv/docs/api/?ruby#analytics)
|
data/lib/vhx.rb
CHANGED
@@ -29,6 +29,7 @@ require "vhx/objects/video"
|
|
29
29
|
require "vhx/objects/video_file"
|
30
30
|
require "vhx/objects/customer"
|
31
31
|
require "vhx/objects/authorization"
|
32
|
+
require "vhx/objects/analytics"
|
32
33
|
|
33
34
|
module Vhx
|
34
35
|
API_BASE_URL = 'https://api.vhx.tv'
|
@@ -39,7 +40,7 @@ module Vhx
|
|
39
40
|
options[:client_secret] ||= @client_secret
|
40
41
|
options[:api_key] ||= @api_key
|
41
42
|
options[:api_base] ||= @api_base_url
|
42
|
-
options[:
|
43
|
+
options[:auto_refresh] = @auto_refresh || false
|
43
44
|
Vhx.client = Vhx::Client.new(options)
|
44
45
|
end
|
45
46
|
|
@@ -47,7 +48,7 @@ module Vhx
|
|
47
48
|
@client_id = config[:client_id]
|
48
49
|
@client_secret = config[:client_secret]
|
49
50
|
@api_key = config[:api_key]
|
50
|
-
@
|
51
|
+
@auto_refresh = config[:auto_refresh] || false
|
51
52
|
@api_base_url = config[:api_base]
|
52
53
|
end
|
53
54
|
|
@@ -63,4 +64,4 @@ module Vhx
|
|
63
64
|
client ? client.connection : nil
|
64
65
|
end
|
65
66
|
end
|
66
|
-
end
|
67
|
+
end
|
data/lib/vhx/client.rb
CHANGED
@@ -7,9 +7,9 @@ module Vhx
|
|
7
7
|
@api_base_url = options[:api_base] || API_BASE_URL
|
8
8
|
@client_id = options[:client_id]
|
9
9
|
@client_secret = options[:client_secret]
|
10
|
-
@oauth_token = options[:api_key] ? nil : OAuthToken.new(options, refreshed = false)
|
10
|
+
@oauth_token = options[:api_key] ? nil : OAuthToken.new(options[:oauth_token], refreshed = false)
|
11
11
|
@api_key = options[:api_key]
|
12
|
-
@
|
12
|
+
@auto_refresh = options[:auto_refresh]
|
13
13
|
@ssl = options[:ssl] || {}
|
14
14
|
@headers = {}
|
15
15
|
|
@@ -21,7 +21,10 @@ module Vhx
|
|
21
21
|
faraday.request :url_encoded
|
22
22
|
faraday.request :json
|
23
23
|
faraday.response :logger
|
24
|
-
|
24
|
+
|
25
|
+
if @auto_refresh
|
26
|
+
faraday.use Vhx::Middleware::OAuth2, :vhx_client => self
|
27
|
+
end
|
25
28
|
|
26
29
|
faraday.adapter Faraday.default_adapter
|
27
30
|
|
@@ -75,11 +75,11 @@ module Vhx
|
|
75
75
|
associations = (obj_hash.fetch('_links', {}).keys | obj_hash.fetch('_embedded', {}).keys).select{|k| ASSOCIATION_WHITELIST.include?(k)}
|
76
76
|
associations.each do |association_method|
|
77
77
|
self.class.send(:define_method, association_method) do |payload = {}|
|
78
|
-
if payload.empty? && obj_hash['_embedded'] && obj_hash['_embedded'].
|
78
|
+
if payload.empty? && obj_hash['_embedded'] && obj_hash['_embedded'].has_key?(association_method)
|
79
79
|
return instance_variable_set("@#{association_method}", fetch_embedded_association(obj_hash, association_method))
|
80
80
|
end
|
81
81
|
|
82
|
-
if obj_hash['_links'] && obj_hash['_links'].
|
82
|
+
if obj_hash['_links'] && obj_hash['_links'].has_key?(association_method)
|
83
83
|
return instance_variable_set("@#{association_method}", fetch_linked_association(obj_hash, association_method, payload))
|
84
84
|
end
|
85
85
|
|
data/lib/vhx/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Vhx
|
2
|
-
VERSION = "0.0.
|
3
|
-
end
|
2
|
+
VERSION = "0.0.8"
|
3
|
+
end
|
data/spec/client_spec.rb
CHANGED
@@ -1,20 +1,47 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Vhx::Client
|
3
|
+
describe Vhx::Client do
|
4
|
+
def application_only_credentials
|
5
|
+
{api_key: "-12345"}
|
6
|
+
end
|
7
|
+
|
8
|
+
def application_user_credentials
|
9
|
+
{
|
10
|
+
client_id: '12345',
|
11
|
+
client_secret: '12345',
|
12
|
+
oauth_token: {
|
13
|
+
access_token: "123456",
|
14
|
+
refresh_token: "12345",
|
15
|
+
expires_at: 1430330123,
|
16
|
+
expires_in: 7200
|
17
|
+
}
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
4
21
|
describe 'faraday configuration' do
|
5
|
-
|
22
|
+
let(:vhx_client){ Vhx::Client.new(application_only_credentials)}
|
6
23
|
|
7
24
|
it 'uses custom error response middleware' do
|
8
25
|
expect(vhx_client.connection.builder.handlers).to include(Vhx::Middleware::ErrorResponse)
|
9
26
|
end
|
10
27
|
|
28
|
+
it 'does not utilize oauth2 middleware by default' do
|
29
|
+
expect(vhx_client.connection.builder.handlers).to_not include(Vhx::Middleware::OAuth2)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'utilizes oauth2 middleware if auto_refresh option passed' do
|
33
|
+
credentials = application_only_credentials.merge(auto_refresh: true)
|
34
|
+
vhx_client = Vhx::Client.new(credentials)
|
35
|
+
expect(vhx_client.connection.builder.handlers).to include(Vhx::Middleware::OAuth2)
|
36
|
+
end
|
37
|
+
|
11
38
|
it 'uses api host' do
|
12
|
-
expect(vhx_client.connection.url_prefix.host).to eq 'api.
|
39
|
+
expect(vhx_client.connection.url_prefix.host).to eq 'api.vhx.tv'
|
13
40
|
end
|
14
41
|
end
|
15
42
|
|
16
43
|
context 'application_only' do
|
17
|
-
|
44
|
+
let(:vhx_client){ Vhx::Client.new(application_only_credentials)}
|
18
45
|
|
19
46
|
describe 'connection' do
|
20
47
|
it 'initializes faraday connection' do
|
@@ -32,7 +59,7 @@ describe Vhx::Client, :vcr do
|
|
32
59
|
end
|
33
60
|
|
34
61
|
context 'application_user' do
|
35
|
-
|
62
|
+
let!(:vhx_client){ Vhx::Client.new(application_user_credentials)}
|
36
63
|
|
37
64
|
it 'oauth_token presence' do
|
38
65
|
expect(vhx_client.oauth_token).to be_an_instance_of(OAuthToken)
|
@@ -53,17 +80,25 @@ describe Vhx::Client, :vcr do
|
|
53
80
|
end
|
54
81
|
|
55
82
|
describe '#refresh_access_token!' do
|
56
|
-
|
57
|
-
let!(:original_access_token){ oauth_token.access_token }
|
58
|
-
before { vhx_client.refresh_access_token! }
|
83
|
+
let(:oauth_token){ vhx_client.oauth_token }
|
59
84
|
|
60
85
|
it 'oauth_token refreshed' do
|
86
|
+
new_token_hash = {access_token: '123', refresh_token: '456', expires_in: '3600'}
|
87
|
+
new_token_response = OpenStruct.new(body: new_token_hash)
|
88
|
+
Faraday::Connection.any_instance.stub(:post).and_return(new_token_response)
|
89
|
+
original_access_token = oauth_token.access_token
|
90
|
+
vhx_client.refresh_access_token!
|
61
91
|
expect(vhx_client.oauth_token.refreshed).to eq(true)
|
62
92
|
end
|
63
93
|
|
64
94
|
it 'access_token changed' do
|
95
|
+
new_token_hash = {access_token: '123', refresh_token: '456', expires_in: '3600'}
|
96
|
+
new_token_response = OpenStruct.new(body: new_token_hash)
|
97
|
+
Faraday::Connection.any_instance.stub(:post).and_return(new_token_response)
|
98
|
+
original_access_token = oauth_token.access_token
|
99
|
+
vhx_client.refresh_access_token!
|
65
100
|
expect(vhx_client.oauth_token.access_token).to_not eq(original_access_token)
|
66
101
|
end
|
67
102
|
end
|
68
103
|
end
|
69
|
-
end
|
104
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"_links": {
|
3
|
+
"customer": {
|
4
|
+
"href": "https://api.vhx.tv/customers/1"
|
5
|
+
},
|
6
|
+
"video": {
|
7
|
+
"href": "https://api.vhx.tv/videos/1"
|
8
|
+
}
|
9
|
+
},
|
10
|
+
"token": "QVJ-cavyvwSX6JpafMCX7zsd1wKg2XfDuZnN",
|
11
|
+
"expires_at": "2015-11-10T23:46:46Z",
|
12
|
+
"player": {
|
13
|
+
"host": "https://embed.vhx.tv",
|
14
|
+
"path": "/videos/1",
|
15
|
+
"html": "<iframe src=\"https://embed.vhx.tv/videos/1?authorization=QVJ-cavyvwSX6JpafMCX7zsd1wKg2XfDuZnN\" width=\"640\" height=\"360\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>"
|
16
|
+
},
|
17
|
+
"created_at": "2015-11-10T22:46:46Z",
|
18
|
+
"updated_at": "2015-11-10T22:46:46Z"
|
19
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"_links": {
|
3
|
+
"self": { "href": "https://api.vhx.tv/collections/1" },
|
4
|
+
"items": { "href": "https://api.vhx.tv/collections/1/items" }
|
5
|
+
},
|
6
|
+
"id": 1,
|
7
|
+
"name": "Comedy",
|
8
|
+
"description": "Comedy series and movies.",
|
9
|
+
"slug": "comedy",
|
10
|
+
"thumbnail": {
|
11
|
+
"small": "https://cdn.vhx.tv/assets/thumbnails/default-small.png",
|
12
|
+
"medium": "https://cdn.vhx.tv/assets/thumbnails/default-medium.png",
|
13
|
+
"large": "https://cdn.vhx.tv/assets/thumbnails/default-large.png",
|
14
|
+
"source": "https://cdn.vhx.tv/assets/thumbnails/original.jpg"
|
15
|
+
},
|
16
|
+
"type": "category",
|
17
|
+
"items_count": 10,
|
18
|
+
"created_at": "2014-02-25T20:19:30Z",
|
19
|
+
"updated_at": "2014-02-25T20:19:30Z"
|
20
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"_links": {
|
3
|
+
"self": { "href": "https://api.vhx.tv/collections?page=1&product=:href" },
|
4
|
+
"first": { "href": "https://api.vhx.tv/collections?product=:href" },
|
5
|
+
"prev": { "href": null },
|
6
|
+
"next": { "href": "https://api.vhx.tv/collections?page=2&product=:href" },
|
7
|
+
"last": { "href": "https://api.vhx.tv/collections?page=5&product=:href" }
|
8
|
+
},
|
9
|
+
"count": 100,
|
10
|
+
"total": 500,
|
11
|
+
"_embedded": {
|
12
|
+
"collections": []
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"_links": {
|
3
|
+
"self": { "href": "https://api.vhx.tv/videos/1" },
|
4
|
+
"files": { "href": "https://api.vhx.tv/videos/1/files" }
|
5
|
+
},
|
6
|
+
"_embedded": {
|
7
|
+
"files": []
|
8
|
+
},
|
9
|
+
"id": 1,
|
10
|
+
"title": "My Video",
|
11
|
+
"description": "My video description.",
|
12
|
+
"status": "processing",
|
13
|
+
"duration": {
|
14
|
+
"seconds": 7200,
|
15
|
+
"formatted": "02:00:00"
|
16
|
+
},
|
17
|
+
"thumbnail": {
|
18
|
+
"small": "https://cdn.vhx.tv/assets/thumbnails/default-small.png",
|
19
|
+
"medium": "https://cdn.vhx.tv/assets/thumbnails/default-medium.png",
|
20
|
+
"large": "https://cdn.vhx.tv/assets/thumbnails/default-large.png",
|
21
|
+
"source": "https://cdn.vhx.tv/assets/thumbnails/original.jpg"
|
22
|
+
},
|
23
|
+
"tracks": {
|
24
|
+
"subtitles": []
|
25
|
+
},
|
26
|
+
"advertising": {},
|
27
|
+
"metadata": {
|
28
|
+
"advertising_keywords": []
|
29
|
+
},
|
30
|
+
"files_count": 0,
|
31
|
+
"created_at": "2014-02-25T20:19:30Z",
|
32
|
+
"updated_at": "2014-02-25T20:19:30Z"
|
33
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"_links": {
|
3
|
+
"self": { "href": "https://api.vhx.tv/customers/1" },
|
4
|
+
"watchlist": { "href": "https://api.vhx.tv/customers/1/watchlist" },
|
5
|
+
"watching": { "href": "https://api.vhx.tv/customers/1/watching" },
|
6
|
+
"products": { "href": "https://api.vhx.tv/products/1" }
|
7
|
+
},
|
8
|
+
"_embedded": {
|
9
|
+
"products": []
|
10
|
+
},
|
11
|
+
"id": 1,
|
12
|
+
"name": "First Last",
|
13
|
+
"email": "customer@email.com",
|
14
|
+
"created_at": "2014-02-25T20:19:30Z",
|
15
|
+
"updated_at": "2014-02-25T20:19:30Z"
|
16
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"_links": {
|
3
|
+
"self": { "href": "https://api.vhx.tv/customers?page=1&query=term" },
|
4
|
+
"first": { "href": "https://api.vhx.tv/customers?query=term" },
|
5
|
+
"prev": { "href": null },
|
6
|
+
"next": { "href": "https://api.vhx.tv/customers?page=2&query=term" },
|
7
|
+
"last": { "href": "https://api.vhx.tv/customers?page=5&query=term" }
|
8
|
+
},
|
9
|
+
"count": 100,
|
10
|
+
"total": 500,
|
11
|
+
"_embedded": {
|
12
|
+
"customers": [
|
13
|
+
{
|
14
|
+
"_links": {
|
15
|
+
"self": { "href": "https://api.vhx.tv/customers/1" },
|
16
|
+
"watchlist": { "href": "https://api.vhx.tv/customers/1/watchlist" },
|
17
|
+
"watching": { "href": "https://api.vhx.tv/customers/1/watching" }
|
18
|
+
},
|
19
|
+
"_embedded": {},
|
20
|
+
"id": 1,
|
21
|
+
"name": "First Last",
|
22
|
+
"email": "customer@email.com",
|
23
|
+
"created_at": "2014-02-25T20:19:30Z",
|
24
|
+
"updated_at": "2014-02-25T20:19:30Z"
|
25
|
+
}
|
26
|
+
]
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
[{
|
2
|
+
"_links": {
|
3
|
+
"self": { "href": "https://api.vhx.tv/videos/1/files?quality=adaptive&format=m3u8" },
|
4
|
+
"source": { "href": "https://video.vhx.tv/mymovie/adaptive.m3u8?token=f4v3v3i4c2o209_3" }
|
5
|
+
},
|
6
|
+
"quality": "adaptive",
|
7
|
+
"format": "m3u8",
|
8
|
+
"method": "hls",
|
9
|
+
"size": {
|
10
|
+
"bytes": 1073741824,
|
11
|
+
"formatted": "1 GB"
|
12
|
+
},
|
13
|
+
"mime_type": "application/x-mpegURL",
|
14
|
+
"created_at": "2014-02-25T20:19:30Z",
|
15
|
+
"updated_at": "2014-02-25T20:19:30Z"
|
16
|
+
}]
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"_links": {
|
3
|
+
"self": { "href": "https://api.vhx.tv/products/1" },
|
4
|
+
"collections": { "href": "https://api.vhx.tv/collections?product=:href" },
|
5
|
+
"customers": { "href": "https://api.vhx.tv/customers?product=:href" }
|
6
|
+
},
|
7
|
+
"_embedded": {},
|
8
|
+
"id": 1,
|
9
|
+
"name": "Subscription NOW",
|
10
|
+
"description": "Subscribe to Subscription NOW today!",
|
11
|
+
"thumbnail": {},
|
12
|
+
"price": {
|
13
|
+
"monthly": {
|
14
|
+
"cents": 800,
|
15
|
+
"currency": "USD",
|
16
|
+
"formatted": "$8"
|
17
|
+
},
|
18
|
+
"yearly": {
|
19
|
+
"cents": 6500,
|
20
|
+
"currency": "USD",
|
21
|
+
"formatted": "$65"
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"is_active": true,
|
25
|
+
"series_count": 100,
|
26
|
+
"movies_count": 100,
|
27
|
+
"playlists_count": 100,
|
28
|
+
"created_at": "2014-02-25T20:19:30Z",
|
29
|
+
"updated_at": "2014-02-25T20:19:30Z"
|
30
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"_links": {
|
3
|
+
"self": { "href": "https://api.vhx.tv/products?page=1&query=term" },
|
4
|
+
"first": { "href": "https://api.vhx.tv/products?query=term" },
|
5
|
+
"prev": { "href": null },
|
6
|
+
"next": { "href": "https://api.vhx.tv/products?page=2&query=term" },
|
7
|
+
"last": { "href": "https://api.vhx.tv/products?page=5&query=term" }
|
8
|
+
},
|
9
|
+
"count": 100,
|
10
|
+
"total": 500,
|
11
|
+
"_embedded": {
|
12
|
+
"products": []
|
13
|
+
}
|
14
|
+
}
|
@@ -1,35 +1,24 @@
|
|
1
1
|
{
|
2
2
|
"_links": {
|
3
|
-
"self": { "href": "
|
4
|
-
"
|
5
|
-
"files": { "href": "http://api.crystal.dev/videos/1/files" }
|
3
|
+
"self": { "href": "https://api.vhx.tv/videos/1" },
|
4
|
+
"files": { "href": "https://api.vhx.tv/videos/1/files" }
|
6
5
|
},
|
7
6
|
"_embedded": {
|
8
|
-
"
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
"
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
"
|
21
|
-
|
22
|
-
|
23
|
-
},
|
24
|
-
"quality": "adaptive",
|
25
|
-
"format": "m3u8",
|
26
|
-
"method": "hls",
|
27
|
-
"size": {
|
28
|
-
"bytes": 1073741824,
|
29
|
-
"formatted": "1 GB"
|
30
|
-
},
|
31
|
-
"mime_type": "application/x-mpegURL"
|
32
|
-
}]
|
7
|
+
"files": [
|
8
|
+
{
|
9
|
+
"_links": {
|
10
|
+
"self": { "href": "https://api.vhx.tv/videos/1/files?quality=adaptive&format=m3u8" }
|
11
|
+
},
|
12
|
+
"quality": "adaptive",
|
13
|
+
"format": "m3u8",
|
14
|
+
"method": "hls",
|
15
|
+
"size": {
|
16
|
+
"bytes": 1073741824,
|
17
|
+
"formatted": "1 GB"
|
18
|
+
},
|
19
|
+
"mime_type": "application/x-mpegURL"
|
20
|
+
}
|
21
|
+
]
|
33
22
|
},
|
34
23
|
"id": 1,
|
35
24
|
"title": "My Video",
|
@@ -42,10 +31,37 @@
|
|
42
31
|
"thumbnail": {
|
43
32
|
"small": "https://cdn.vhx.tv/assets/thumbnails/default-small.png",
|
44
33
|
"medium": "https://cdn.vhx.tv/assets/thumbnails/default-medium.png",
|
45
|
-
"large": "https://cdn.vhx.tv/assets/thumbnails/default-large.png"
|
34
|
+
"large": "https://cdn.vhx.tv/assets/thumbnails/default-large.png",
|
35
|
+
"source": "https://cdn.vhx.tv/assets/thumbnails/original.jpg"
|
36
|
+
},
|
37
|
+
"tracks": {
|
38
|
+
"subtitles": [
|
39
|
+
{
|
40
|
+
"_links": {
|
41
|
+
"srt": { "href": "https://cdn.vhx.tv/file.srt" },
|
42
|
+
"vtt": { "href": "https://cdn.vhx.tv/file.vtt" }
|
43
|
+
},
|
44
|
+
"label": "English",
|
45
|
+
"srclang": "en",
|
46
|
+
"kind": "subtitles"
|
47
|
+
}
|
48
|
+
]
|
49
|
+
},
|
50
|
+
"advertising": {
|
51
|
+
"_links": {
|
52
|
+
"tag": { "href": "https://static.vhx.tv/vmap.xml" }
|
53
|
+
},
|
54
|
+
"client": "vmap",
|
55
|
+
"provider": "dfp"
|
56
|
+
},
|
57
|
+
"metadata": {
|
58
|
+
"series_name": "Series Name",
|
59
|
+
"season_name": "Season 1",
|
60
|
+
"season_number": 1,
|
61
|
+
"episode_number": 5,
|
62
|
+
"advertising_keywords": []
|
46
63
|
},
|
47
|
-
"subtitles_count": 3,
|
48
64
|
"files_count": 5,
|
49
65
|
"created_at": "2014-02-25T20:19:30Z",
|
50
66
|
"updated_at": "2014-02-25T20:19:30Z"
|
51
|
-
}
|
67
|
+
}
|