Methods
- A
- C
- P
- V
- W
- Y
Constants
| VIMEO_RECURRING_REGEX | = | %r{^https?://vimeo.com/event/([^/]+)/?$} |
| VIMEO_REGEX | = | %r{^https?://vimeo.com/(?!event)[^/]+/?[^/]+/?$} |
Instance Public methods
as_json(options = {}) Link
Source: show
# File app/models/db/content_video.rb, line 41 def as_json(options = {}) super.as_json(options).merge({ "plan_names" => plan_names.sort, "plan_ids" => plan_ids.sort, "content_type" => "video", "content_link" => content_link }) end
content_type() Link
Source: show
# File app/models/db/content_video.rb, line 50 def content_type "video" end
player_id() Link
Source: show
# File app/models/db/content_video.rb, line 29 def player_id if vimeo? url.split("vimeo.com/").last.split("/").first elsif vimeo_recurring? url.match(VIMEO_RECURRING_REGEX).try(:[], 1) elsif wistia? url.split("medias/").last elsif youtube? get_youtube_player_id end end
vimeo?() Link
Source: show
# File app/models/db/content_video.rb, line 15 def vimeo? # https://vimeo.com/{videoID} or https://vimeo.com/{videoID}/{token} url.match(VIMEO_REGEX).present? end
vimeo_recurring?() Link
Source: show
# File app/models/db/content_video.rb, line 20 def vimeo_recurring? # https://vimeo.com/event/{eventID} url.match(VIMEO_RECURRING_REGEX).present? end