Skip to content

Commit

Permalink
Merged PR #358 fixing conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
obilodeau committed Mar 19, 2020
2 parents 58eadf7 + c537fb9 commit 9a42d82
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions templates/video.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
- unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?
- asset_uri_scheme = %(#{asset_uri_scheme}:)
- start_anchor = (attr? :start) ? "#at=#{attr :start}" : nil
- delimiter = '?'
- loop_param = (option? 'loop') ? "#{delimiter}loop=1" : nil
- src = %(#{asset_uri_scheme}//player.vimeo.com/video/#{attr :target}#{start_anchor}#{loop_param})
- delimiter = ['?']
- loop_param = (option? 'loop') ? %(#{delimiter.pop || '&'}loop=1) : ''
- muted_param = (option? 'muted') ? %(#{delimiter.pop || '&'}muted=1) : ''
- src = %(#{asset_uri_scheme}//player.vimeo.com/video/#{attr :target}#{loop_param}#{muted_param}#{start_anchor})
/ We need to delegate autoplay into the iframe starting with Chrome 62 (and other browsers too)
/ See https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#iframe
iframe(width=(width) height=(height) src=src frameborder=0
Expand All @@ -28,6 +29,7 @@
- params << "start=#{attr :start}" if attr? :start
- params << "end=#{attr :end}" if attr? :end
- params << "loop=1" if option? 'loop'
- params << "mute=1" if option? 'muted'
- params << "controls=0" if option? 'nocontrols'
- src = %(#{asset_uri_scheme}//www.youtube.com/embed/#{attr :target}?#{params * '&amp;'})
/ We need to delegate autoplay into the iframe starting with Chrome 62 (and other browsers too)
Expand Down

0 comments on commit 9a42d82

Please sign in to comment.