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 included from EmbedCode
#embed_code
Methods inherited from Provider
#==, #accessible?, delegate, #embed_code, #playlist_id, #videos
Constructor Details
#initialize(url, fetched = nil) ⇒ Vimeo
Returns a new instance of Vimeo.
17
18
19
20
|
# File 'lib/provider/vimeo/vimeo.rb', line 17
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
13
14
15
|
# File 'lib/provider/vimeo/vimeo.rb', line 13
def self.new_from_video_id(video_id, fetched=nil)
new("http://vimeo.com/#{video_id}", fetched)
end
|
.useable?(url) ⇒ Boolean
8
9
10
11
|
# File 'lib/provider/vimeo/vimeo.rb', line 8
def self.useable?(url)
uri = URISchemeless.parse(url)
USEABLE.include?(uri.host)
end
|
Instance Method Details
#api_url ⇒ Object
30
31
32
|
# File 'lib/provider/vimeo/vimeo.rb', line 30
def api_url
"http://vimeo.com/api/v2/video/#{video_id}.json"
end
|
#default_attributes ⇒ Object
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/provider/vimeo/vimeo.rb', line 38
def default_attributes
{
iframe_attributes: {
frameborder: 0,
webkitallowfullscreen: true,
mozallowfullscreen: true,
allowfullscreen: true
}
}
end
|
#description ⇒ Object
53
54
55
|
# File 'lib/provider/vimeo/vimeo.rb', line 53
def description
fetch.description
end
|
#duration ⇒ Object
57
58
59
|
# File 'lib/provider/vimeo/vimeo.rb', line 57
def duration
fetch.duration
end
|
#embed_url ⇒ Object
34
35
36
|
# File 'lib/provider/vimeo/vimeo.rb', line 34
def embed_url
"//player.vimeo.com/video/#{video_id}"
end
|
#provider ⇒ Object
22
23
24
|
# File 'lib/provider/vimeo/vimeo.rb', line 22
def provider
"Vimeo"
end
|
#thumbnail_large ⇒ Object
73
74
75
|
# File 'lib/provider/vimeo/vimeo.rb', line 73
def thumbnail_large
fetch.thumbnail_large
end
|
#thumbnail_medium ⇒ Object
69
70
71
|
# File 'lib/provider/vimeo/vimeo.rb', line 69
def thumbnail_medium
fetch.thumbnail_medium
end
|
#thumbnail_small ⇒ Object
65
66
67
|
# File 'lib/provider/vimeo/vimeo.rb', line 65
def thumbnail_small
fetch.thumbnail_small
end
|
#title ⇒ Object
49
50
51
|
# File 'lib/provider/vimeo/vimeo.rb', line 49
def title
fetch.title
end
|
#unpack_into ⇒ Object
77
78
79
80
|
# File 'lib/provider/vimeo/vimeo.rb', line 77
def unpack_into
struct = []
struct.extend(VimeoVideosRepresenter)
end
|
#upload_date ⇒ Object
61
62
63
|
# File 'lib/provider/vimeo/vimeo.rb', line 61
def upload_date
fetch.upload_date
end
|
#video_id ⇒ Object
26
27
28
|
# File 'lib/provider/vimeo/vimeo.rb', line 26
def video_id
@video_id ||= calculate_video_id
end
|