Method: VideoInfo::Provider#embed_code

Defined in:
lib/video_info/provider.rb

#embed_code(options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/video_info/provider.rb', line 24

def embed_code(options = {})
  iframe_attributes = options.fetch(:iframe_attributes, {})
  iframe_attrs = ["src=\"#{_embed_url(options)}\"", 'frameborder="0"']
  iframe_attrs << _hash_to_attributes(
    _default_iframe_attributes.merge(iframe_attributes)
  )

  "<iframe #{iframe_attrs.reject(&:empty?).join(" ")}></iframe>"
end