Class: Lumiere::VimeoPlaylist
Defined Under Namespace
Classes: VideoFetcher
Constant Summary
collapse
- USEABLE =
['vimeo.com', 'player.vimeo.com', 'www.vimeo.com']
- RESULTS_PER_REQUEST =
20
Constants inherited
from Provider
Provider::PROVIDERS
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from EmbedCode
#embed_code
Methods inherited from Provider
#==, #accessible?, delegate, #duration, #embed_code, #video_id
Constructor Details
Returns a new instance of VimeoPlaylist.
16
17
18
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 16
def initialize(url)
@url = url
end
|
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
3
4
5
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 3
def url
@url
end
|
Class Method Details
.useable?(url) ⇒ Boolean
9
10
11
12
13
14
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 9
def self.useable?(url)
uri = URISchemeless.parse(url)
return false unless USEABLE.include?(uri.host)
split_path = uri.path.split('/')
split_path.include?('album')
end
|
Instance Method Details
#api_url ⇒ Object
28
29
30
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 28
def api_url
"http://vimeo.com/api/v2/album/#{playlist_id}/info.json"
end
|
#default_attributes ⇒ Object
36
37
38
39
40
41
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 36
def default_attributes
{
iframe_attributes: { frameborder: 0 },
url_attributes: { autoplay: 0, byline: 0, portrait: 0, title: 0 }
}
end
|
#description ⇒ Object
47
48
49
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 47
def description
fetch.description
end
|
#embed_url ⇒ Object
32
33
34
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 32
def embed_url
"//player.vimeo.com/hubnut/album/#{playlist_id}"
end
|
#playlist_id ⇒ Object
24
25
26
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 24
def playlist_id
@playlist_id ||= calculate_playlist_id
end
|
#provider ⇒ Object
20
21
22
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 20
def provider
"Vimeo"
end
|
#thumbnail_large ⇒ Object
63
64
65
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 63
def thumbnail_large
fetch.thumbnail_large
end
|
#thumbnail_medium ⇒ Object
59
60
61
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 59
def thumbnail_medium
fetch.thumbnail_medium
end
|
#thumbnail_small ⇒ Object
55
56
57
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 55
def thumbnail_small
fetch.thumbnail_small
end
|
#title ⇒ Object
43
44
45
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 43
def title
fetch.title
end
|
#total_videos ⇒ Object
67
68
69
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 67
def total_videos
fetch.total_videos
end
|
#unpack_into ⇒ Object
71
72
73
74
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 71
def unpack_into
struct = OpenStruct.new
struct.extend(VimeoPlaylistRepresenter)
end
|
#upload_date ⇒ Object
51
52
53
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 51
def upload_date
fetch.upload_date
end
|
#videos ⇒ Object
76
77
78
|
# File 'lib/provider/vimeoplaylist/vimeoplaylist.rb', line 76
def videos
@videos ||= VideoFetcher.new(playlist_id, total_videos).videos
end
|