Get event of fotorama video play button being clicked

575 Views Asked by At

I want to obtain the event during which this video player button is clicked

enter image description here

I want to observe when and how many the amount of it being clicked

I try to use the below code

require(['jquery'], function($){

    $('fotorama__stage__frame.fotorama-video-container.magnify-wheel-loaded.fotorama_vertical_ratio.fotorama__loaded.fotorama__loaded--img.video-unplayed.fotorama__fade-rear.fotorama__active').click(function(){
        alert('A');
    })

})
require(['jquery'], function($){
    
    $('div.product-video').click(function(){
        alert('A');
    })

})

but neither are working

I also tried doing as below to get the details upon on fotoroma:showend but unable to find any action triggered during the button is clicked

 .on('fotorama:fullscreenenter fotorama:showend', function (e, fotorama) {


      if(fotorama.activeFrame.$stageFrame){

          $('div.product-video').click(function(){
                  alert('A');
          })

      }
            
})

Not sure how do I obtain this click event. Anyone can help give suggestion?

Any help is kindly appreciated

1

There are 1 best solutions below

0
Mohd Farhan Bin Ramli On

Able to get the clickable element for this by using

require(['jquery'], function($){ 

$(document).on('click', '.fotorama__stage__shaft', function () { 
    console.log(this); 
}); 

}) 

Putting this here for reference if someone were to encounter this same issue in magento 2