Class: HostedVideo::Providers::Youtube
- Inherits:
-
Base
- Object
- Base
- HostedVideo::Providers::Youtube
show all
- Defined in:
- lib/hosted_video/providers/youtube.rb
Instance Attribute Summary
Attributes inherited from Base
#url
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#iframe_code, #initialize, #kind, #vid
Class Method Details
.can_parse?(url) ⇒ Boolean
5
6
7
|
# File 'lib/hosted_video/providers/youtube.rb', line 5
def self.can_parse?(url)
url =~ /(youtube\.com\/watch\?v=)|(youtu\.be\/)/
end
|
Instance Method Details
#preview ⇒ Object
9
10
11
|
# File 'lib/hosted_video/providers/youtube.rb', line 9
def preview
"http://img.youtube.com/vi/#{vid}/hqdefault.jpg"
end
|
#url_for_iframe ⇒ Object
13
14
15
|
# File 'lib/hosted_video/providers/youtube.rb', line 13
def url_for_iframe
"http://www.youtube.com/embed/#{vid}?wmode=transparent"
end
|