Permalink
Browse files

Merge pull request #39 from dopin/lack_of_iframe_close_tag

fixed Video#embed_html5 HTML syntax error lack of </iframe>
  • Loading branch information...
2 parents 31af35d + 5245e39 commit be739a73477c794e7a3b74fb6e990f481bc54b21 @kylejginavan committed Dec 19, 2011
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/youtube_it/model/video.rb
  2. +5 −0 test/test_video.rb
@@ -203,7 +203,7 @@ def embed_html5(params = {})
:frameborder => params[:frameborder] || "0"
}
<<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 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>
EDOC
end
View
@@ -39,5 +39,10 @@ def test_should_scale_video_embed
video = YouTubeIt::Model::Video.new(:video_id => "tag:youtube.com,2008:video:EkF4JD2rO3Q", :player_url=>"http://www.youtube.com/v/EkF4JD2rO3Q&feature=youtube_gdata_player", :widescreen => true)
assert_equal "<object width=\"1280\" height=\"745\">\n<param name=\"movie\" value=\"http://www.youtube.com/v/EkF4JD2rO3Q&feature=youtube_gdata_player\"></param>\n<param name=\"wmode\" value=\"transparent\"></param>\n<embed src=\"http://www.youtube.com/v/EkF4JD2rO3Q&feature=youtube_gdata_player\" type=\"application/x-shockwave-flash\"\nwmode=\"transparent\" width=\"1280\" height=\"745\"></embed>\n</object>\n", video.embed_html_with_width(1280)
end
+
+ def test_should_have_iframe_close_tag
+ video = YouTubeIt::Model::Video.new(:video_id => "tag:youtube.com,2008:video:EkF4JD2rO3Q")
+ assert_equal "<iframe class=\"\" id=\"\" type=\"text/html\" width=\"425\" height=\"350\" src=\"http://www.youtube.com/embed/EkF4JD2rO3Q\" frameborder=\"0\"></iframe>\n", video.embed_html5
+ end
end

0 comments on commit be739a7

Please sign in to comment.