Skip to content

Commit

Permalink
Adding ability to specify URL options to the html5 embed
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Mar 12, 2012
1 parent 7e6cce0 commit 0aa2738
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/youtube_it/model/video.rb
Expand Up @@ -202,10 +202,11 @@ def embed_html5(params = {})
:id => params[:id] || "",
:width => params[:width] || "425",
:height => params[:height] || "350",
:frameborder => params[:frameborder] || "0"
:frameborder => params[:frameborder] || "0",
:url_params => params[:url_params] || {}
}
<<EDOC
<iframe class="#{opts[:class]}" id="#{opts[:id]}" type="text/html" width="#{opts[:width]}" height="#{opts[:height]}" src="http://www.youtube.com/embed/#{unique_id}" frameborder="#{opts[:frameborder]}"></iframe>
<iframe class="#{opts[:class]}" id="#{opts[:id]}" type="text/html" width="#{opts[:width]}" height="#{opts[:height]}" src="http://www.youtube.com/embed/#{unique_id}?#{Rack::Utils::build_query(opts[:url_params])}" frameborder="#{opts[:frameborder]}"></iframe>
EDOC
end

Expand Down

0 comments on commit 0aa2738

Please sign in to comment.