Class: MarkdownVideos::Services::YoutubeService
- Inherits:
-
ServiceBase
- Object
- ServiceBase
- MarkdownVideos::Services::YoutubeService
show all
- Defined in:
- lib/markdown_videos/services/youtube_service.rb
Instance Attribute Summary
Attributes inherited from ServiceBase
#alt_text, #class_name, #markdown_url, #markdown_url_data, #resource_id, #wrapper
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from ServiceBase
#html_attributes, #html_dom_properties, #initialize, #render, #service_url, support, #to_html
Class Method Details
.regexp ⇒ Object
5
6
7
|
# File 'lib/markdown_videos/services/youtube_service.rb', line 5
def self.regexp
/^(https?:\/\/(?:youtu.be\/|www.youtube.com\/(?:watch\?v=|embed\/))([\w\-]{4,16})\??([\w\-\=]+)?)$/
end
|
Instance Method Details
#height ⇒ Object
13
14
15
|
# File 'lib/markdown_videos/services/youtube_service.rb', line 13
def height
315
end
|
#url ⇒ Object
17
18
19
|
# File 'lib/markdown_videos/services/youtube_service.rb', line 17
def url
"https://www.youtube.com/embed/#{resource_id}"
end
|
#url_parameters ⇒ Object
21
22
23
|
# File 'lib/markdown_videos/services/youtube_service.rb', line 21
def url_parameters
[:start]
end
|
#width ⇒ Object
9
10
11
|
# File 'lib/markdown_videos/services/youtube_service.rb', line 9
def width
560
end
|