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 ?
Asked
Active
Viewed 256 times
2
-
See :https://stackoverflow.com/a/54252590/5065348 – AnsonChen Jan 18 '19 at 11:16
1 Answers
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');
}
});