Module: LinkingPaths::Videoclub::Helper
- Defined in:
- lib/videoclub_helper.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#video_embed_code(video, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/videoclub_helper.rb', line 5 def (video, ={}) [:width] ||= "452" [:height] ||= "354" case video.source_url when /youtube/ video.source_url =~ /v=([^&]+)/ id = $1 <<-EOS <object width="#{[:width]}" height="#{[:height]}"> <param name="movie" value="http://www.youtube.com/v/#{id}&hl=es"></param> <param name="wmode" value="transparent"></param> <embed src="http://www.youtube.com/v/#{id}&hl=es" type="application/x-shockwave-flash" wmode="transparent" width="#{[:width]}" height="#{[:height]}"></embed> </object> EOS when /vimeo/ video.source_url =~ /vimeo.com\/([^&]+)/ id = $1 <<-EOS <object type="application/x-shockwave-flash" width="#{[:width]}" height="#{[:height]}" data="http://www.vimeo.com/moogaloop.swf?clip_id=#{id}&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color="> <param name="quality" value="best" /> <param name="allowfullscreen" value="true" /> <param name="scale" value="showAll" /> <param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=#{id}&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=" /> </object> EOS else "El servicio de video usado no está soportado aun por el sistema o la url es incorrecta." end end |