<% url = component[:attributes][:url].to_s if 'vimeo'.in? url video_id = url.gsub(/\A(?:https?:)?\/\/(?:(?:www|player)\.)?vimeo\.com\/(?:video\/)?(\d+).*?\z/, '\1') iframe_src = "https://player.vimeo.com/video/#{video_id}?color=ffffff&title=0&byline=0&portrait=0" elsif 'youtube'.in? url video_id = url.split('watch?v=').last iframe_src = "http://www.youtube.com/embed/#{video_id}" else iframe_src = url end %>
<% if iframe_src.present? %> <% end %>