Sha256: 629c448c6352d6311c947c668ed7f9a662383d845bcdaddc2b67853d97745482

Contents?: true

Size: 718 Bytes

Versions: 21

Compression:

Stored size: 718 Bytes

Contents

$(document).ready ->
  $('body').on 'click', '[data-video-control="toggle"]', ->
    video = $($(@).data('video-target'))
    if video.prop('paused')
      video.trigger('play')
      $(@).html('<i class="fas fa-pause">');
    else
      video.trigger('pause')
      $(@).html('<i class="fas fa-play">');

  $('body').on 'click', '[data-video-control="play"]', ->
    video = $($(@).data('video-target'))
    video.trigger('play')

  $('body').on 'click', '[data-video-control="pause"]', ->
    video = $($(@).data('video-target'))
    video.trigger('pause')

  $('body').on 'click', '[data-video-control="stop"]', ->
    video = $($(@).data('video-target'))
    video.trigger('pause')
    video.attr('currentTime', 0)

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cmor_carousels-0.0.38.pre app/assets/javascripts/cmor/carousels/application/carousel-video.js.coffee