2

I am displaying a vimeo player inside a WebView on Android. My question is:I need track the "play" event and "pause" event or even the "progress of the video" using JavaScriptInterface how can I achieve this ?

Kamalesh Wankhede
  • 1,475
  • 16
  • 37
Metwalli
  • 1,861
  • 1
  • 18
  • 27

1 Answers1

2

You can find a full implementation here. You can also get the embed html for a video using the vimeo-networking-java SDK. But the part you need to know is:

froogaloop.addEvent('playProgress', function(data) {
               if(!showingPlayer && data.percent > 0) {
                  showingPlayer = true;
                  jQuery('.froog_container_class').show();
                  jQuery('.froog_container_class').css('height', '_windowHeight');
                  jQuery('.froog_container_class').css('width', '_windowWidth');
                  /* Most tablets I tested aren't quick enough to make this work
                     but one can still hope */
                  jQuery('#loading').fadeOut('slow');
               }
           });
Community
  • 1
  • 1
Kyle Venn
  • 4,597
  • 27
  • 41