Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Ability to Specify URL Parameters When Using HTML5 Embed #65

Merged
merged 1 commit into from

2 participants

@iloveitaly

Useful for specifying a theme, related video options, etc

@kylejginavan kylejginavan merged commit 0111a05 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/youtube_it/model/video.rb
View
5 lib/youtube_it/model/video.rb
@@ -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
Something went wrong with that request. Please try again.