Sha256: 899aa47f8fd3671886b15c59d7776331ff1b1404b1db5dde7bf723690c90cffd

Contents?: true

Size: 880 Bytes

Versions: 1

Compression:

Stored size: 880 Bytes

Contents

module ViewHelpers
  def embed_video(embeddable, width, height)
    attributes = { id: embeddable.video_id, width: width, height: height }

    if embeddable.video_on_youtube?
      render 'embeddable/partials/youtube', attributes
    elsif embeddable.video_on_vimeo?
      render 'embeddable/partials/vimeo', attributes
    elsif embeddable.video_on_dailymotion?
      render 'embeddable/partials/dailymotion', attributes
    elsif embeddable.video_on_veoh?
      render 'embeddable/partials/veoh', attributes
    elsif embeddable.video_on_vippy?
      render 'embeddable/partials/vippy', attributes
    elsif embeddable.video_on_liveleak?
      # not supported
      link_to embeddable.url, embeddable.url
    elsif embeddable.video_on_brightcove?
      render 'embeddable/partials/brightcove', attributes
    else
      link_to embeddable.url, embeddable.url
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
embeddable-0.0.7 lib/embeddable/view_helpers.rb