How to get Play Progress of Vimeo video from android webview?

861 Views Asked by At

I m building an app which requires vimeo video play support. I got success in playing video but dont know how to get current video play progress. I am using HTML5WebView as suggested in https://github.com/droid28/VimeoVideo. If anybody has idea..please suggest.. Thanks

Here is the Code:

webview = (WebView)findViewById(R.id.webView1);
WebSettings webViewSettings = webview.getSettings();
webViewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webview.addJavascriptInterface(new JavaScriptInterface(this),"jsInterface");
webview.setWebChromeClient(new WebChromeClient());    
webViewSettings.setJavaScriptEnabled(true);
webViewSettings.setPluginState(PluginState.ON);

 String page="<html> " +
                "<head> " +
                    "<style>" +
                        "iframe {" +
                            "position: absolute;" +
                            "z-index: 1;" +
                            "top: 0;" +
                            "left: 0;" +
                            "width: 100%;" +
                            "height: 100%;" +
                        "}" +
                    "</style>" +
                "</head>" +
                    "<body>" +
                        "<iframe id=\"player\" src=\"http://player.vimeo.com/video/"+video_id+"?api=1&player_id=player\" width=\"400\" height=\"225\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen>" +
                        "</iframe>" +
                    "</body>" +
                "</html>";



webview.loadDataWithBaseURL("file:///android_asset/page.html", page,"text/html", "UTF-8",null);
1

There are 1 best solutions below

0
On

I'm looking for the same thing but I think, unfortunately, the answer is still that their player doesn't support play progress events on mobile

See this table to see which events are supported on which platform https://developer.vimeo.com/player/js-api#event-compatibility