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.
20
21
22
23
|
# File 'lib/provider/vimeo/vimeo.rb', line 20
def initialize(url, fetched=nil)
@url = url
@fetched = fetched
end
|
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
6
7
8
|
# File 'lib/provider/vimeo/vimeo.rb', line 6
def url
@url
end
|
Class Method Details
.new_from_video_id(video_id, fetched = nil) ⇒ Object
16
17
18
|
# File 'lib/provider/vimeo/vimeo.rb', line 16
def self.new_from_video_id(video_id, fetched=nil)
new("http://vimeo.com/#{video_id}", fetched)
end
|
.useable?(url) ⇒ Boolean
11
12
13
14
|
# File 'lib/provider/vimeo/vimeo.rb', line 11
def self.useable?(url)
uri = URISchemeless.parse(url)
USEABLE.include?(uri.host)
end
|
Instance Method Details
#api_url ⇒ Object
33
34
35
|
# File 'lib/provider/vimeo/vimeo.rb', line 33
def api_url
"http://vimeo.com/api/v2/video/#{video_id}.json"
end
|
#default_attributes ⇒ Object
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/provider/vimeo/vimeo.rb', line 41
def default_attributes
{
iframe_attributes: {
frameborder: 0,
webkitallowfullscreen: true,
mozallowfullscreen: true,
allowfullscreen: true
}
}
end
|
#description ⇒ Object
56
57
58
|
# File 'lib/provider/vimeo/vimeo.rb', line 56
def description
fetch.description
end
|
#duration ⇒ Object
60
61
62
|
# File 'lib/provider/vimeo/vimeo.rb', line 60
def duration
fetch.duration
end
|
#embed_url ⇒ Object
37
38
39
|
# File 'lib/provider/vimeo/vimeo.rb', line 37
def embed_url
"//player.vimeo.com/video/#{video_id}"
end
|
#provider ⇒ Object
25
26
27
|
# File 'lib/provider/vimeo/vimeo.rb', line 25
def provider
"Vimeo"
end
|
#thumbnail_large ⇒ Object
76
77
78
|
# File 'lib/provider/vimeo/vimeo.rb', line 76
def thumbnail_large
fetch.thumbnail_large
end
|
#thumbnail_medium ⇒ Object
72
73
74
|
# File 'lib/provider/vimeo/vimeo.rb', line 72
def thumbnail_medium
fetch.thumbnail_medium
end
|
#thumbnail_small ⇒ Object
68
69
70
|
# File 'lib/provider/vimeo/vimeo.rb', line 68
def thumbnail_small
fetch.thumbnail_small
end
|
#title ⇒ Object
52
53
54
|
# File 'lib/provider/vimeo/vimeo.rb', line 52
def title
fetch.title
end
|
#unpack_into ⇒ Object
80
81
82
83
|
# File 'lib/provider/vimeo/vimeo.rb', line 80
def unpack_into
struct = []
struct.extend(VimeoVideosRepresenter)
end
|
#upload_date ⇒ Object
64
65
66
|
# File 'lib/provider/vimeo/vimeo.rb', line 64
def upload_date
fetch.upload_date
end
|
#video_id ⇒ Object
29
30
31
|
# File 'lib/provider/vimeo/vimeo.rb', line 29
def video_id
@video_id ||= calculate_video_id
end
|