Class: Lumiere::Vimeo
Constant Summary
collapse
- USEABLE =
['www.vimeo.com', 'vimeo.com', 'player.vimeo.com']
Constants inherited
from Provider
Provider::PROVIDERS
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Provider
#==, #accessible?, delegate, #playlist_id, #videos
Constructor Details
#initialize(url, fetched = nil) ⇒ Vimeo
Returns a new instance of Vimeo.
16
17
18
19
|
# File 'lib/provider/vimeo/vimeo.rb', line 16
def initialize(url, fetched=nil)
@url = url
@fetched = fetched
end
|
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
3
4
5
|
# File 'lib/provider/vimeo/vimeo.rb', line 3
def url
@url
end
|
Class Method Details
.new_from_video_id(video_id, fetched = nil) ⇒ Object
12
13
14
|
# File 'lib/provider/vimeo/vimeo.rb', line 12
def self.new_from_video_id(video_id, fetched=nil)
new("http://vimeo.com/#{video_id}", fetched)
end
|
.useable?(url) ⇒ Boolean
7
8
9
10
|
# File 'lib/provider/vimeo/vimeo.rb', line 7
def self.useable?(url)
uri = URISchemeless.parse(url)
USEABLE.include?(uri.host)
end
|
Instance Method Details
#api_url ⇒ Object
29
30
31
|
# File 'lib/provider/vimeo/vimeo.rb', line 29
def api_url
"http://vimeo.com/api/v2/video/#{video_id}.json"
end
|
#description ⇒ Object
45
46
47
|
# File 'lib/provider/vimeo/vimeo.rb', line 45
def description
fetch.description
end
|
#duration ⇒ Object
49
50
51
|
# File 'lib/provider/vimeo/vimeo.rb', line 49
def duration
fetch.duration
end
|
#embed_code ⇒ Object
37
38
39
|
# File 'lib/provider/vimeo/vimeo.rb', line 37
def embed_code
"<iframe src=\"#{embed_url}\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"
end
|
#embed_url ⇒ Object
33
34
35
|
# File 'lib/provider/vimeo/vimeo.rb', line 33
def embed_url
"//player.vimeo.com/video/#{video_id}"
end
|
#provider ⇒ Object
21
22
23
|
# File 'lib/provider/vimeo/vimeo.rb', line 21
def provider
"Vimeo"
end
|
#thumbnail_large ⇒ Object
65
66
67
|
# File 'lib/provider/vimeo/vimeo.rb', line 65
def thumbnail_large
fetch.thumbnail_large
end
|
#thumbnail_medium ⇒ Object
61
62
63
|
# File 'lib/provider/vimeo/vimeo.rb', line 61
def thumbnail_medium
fetch.thumbnail_medium
end
|
#thumbnail_small ⇒ Object
57
58
59
|
# File 'lib/provider/vimeo/vimeo.rb', line 57
def thumbnail_small
fetch.thumbnail_small
end
|
#title ⇒ Object
41
42
43
|
# File 'lib/provider/vimeo/vimeo.rb', line 41
def title
fetch.title
end
|
#unpack_into ⇒ Object
69
70
71
72
|
# File 'lib/provider/vimeo/vimeo.rb', line 69
def unpack_into
struct = []
struct.extend(VimeoVideosRepresenter)
end
|
#upload_date ⇒ Object
53
54
55
|
# File 'lib/provider/vimeo/vimeo.rb', line 53
def upload_date
fetch.upload_date
end
|
#video_id ⇒ Object
25
26
27
|
# File 'lib/provider/vimeo/vimeo.rb', line 25
def video_id
@video_id ||= calculate_video_id
end
|