class Onebox::Engine::FacebookMediaOnebox

Public Instance Methods

to_html() click to toggle source
# File lib/onebox/engine/facebook_media_onebox.rb, line 13
      def to_html
        metadata = get_twitter
        if metadata.present? && metadata[:card] == "player" && metadata[:player].present?
          <<-HTML
            <iframe
              src="#{metadata[:player]}"
              width="#{metadata[:player_width]}"
              height="#{metadata[:player_height]}"
              scrolling="no"
              frameborder="0"
              allowfullscreen
            ></iframe>
          HTML
        else
          html = Onebox::Engine::AllowlistedGenericOnebox.new(@url, @timeout).to_html
          return if Onebox::Helpers.blank?(html)
          html
        end
      end