Sha256: e10fc8ada9ea0caeaa89407fa1e835f1231f3237ea012a809d60d256b602d13a

Contents?: true

Size: 1.48 KB

Versions: 21

Compression:

Stored size: 1.48 KB

Contents

%div{:id=>@id, :class=>['videoblock', @style, role, ('slide' if option? :step)]}
  - case attr :poster
  - when 'vimeo'
    - start_anchor = (attr? :start) ? "#at=#{attr :start}" : nil
    - delimiter = '?'
    - autoplay_param = (option? :autoplay) ? "#{delimiter}autoplay=1" : nil
    - delimiter = '&' if autoplay_param
    - loop_param = (option? :loop) ? "#{delimiter}loop=1" : nil
    - src = %(//player.vimeo.com/video/#{attr :target}#{start_anchor}#{autoplay_param}#{loop_param})
    %iframe{:width=>(attr :width), :height=>(attr :height), :src=>src, :frameborder=>(attr :frameborder), :webkitAllowFullScreen=>true, :mozallowfullscreen=>true, :allowFullScreen=>true}
  - when 'youtube'
    - params = ['rel=0']
    - params << "start=#{attr :start}" if attr? :start
    - params << "end=#{attr :end}" if attr? :end
    - params << "autoplay=1" if option? :autoplay
    - params << "loop=1" if option? :loop
    - params << "controls=0" if option? :nocontrols
    - src = %(//www.youtube.com/embed/#{attr :target}?#{params * '&amp;'})
    %iframe{:width=>(attr :width), :height=>(attr :height), :src=>src, :frameborder=>(attr :frameborder), :allowfullscreen=>!(option? :nofullscreen)}
  - else
    %video{:src=>media_uri(attr :target), :width=>(attr :width), :height=>(attr :height),
        :poster=>((attr :poster) ? media_uri(attr :poster) : nil), :autoplay=>(option? :autoplay),
        :controls=>!(option? :nocontrols), :loop=>(option? :loop)}
      Your browser does not support the video tag.

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
hyla-1.0.9 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.9.pre.3 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.9.pre.2 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.9.pre.1 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.8 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.7 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.7.pre.9 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.7.pre.8 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.7.pre.7 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.7.pre.6 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.7.pre.5 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.7.pre.3 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.7.pre.2 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.7.pre.1 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.6 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.5 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.5.pre.1 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.4 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.3 lib/resources/backends/haml/deckjs/block_video.html.haml
hyla-1.0.2 lib/resources/backends/haml/deckjs/block_video.html.haml