【问题标题】:How to get Play Progress of Vimeo video from android webview?如何从 android webview 获取 Vimeo 视频的播放进度?
【发布时间】:2013-12-23 09:43:53
【问题描述】:

我正在构建一个需要 vimeo 视频播放支持的应用程序。我在播放视频方面取得了成功,但不知道如何获得当前的视频播放进度。 我正在使用https://github.com/droid28/VimeoVideo 中建议的 HTML5WebView。 如果有人有想法..请建议.. 谢谢

代码如下:

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);

【问题讨论】:

  • 你能显示一些代码吗?

标签: javascript android vimeo vimeo-player


【解决方案1】:

我正在寻找同样的东西,但我认为,不幸的是,答案仍然是他们的播放器不支持移动设备上的播放进度事件

查看此表以了解哪个平台支持哪些事件https://developer.vimeo.com/player/js-api#event-compatibility

【讨论】:

    猜你喜欢
    • 2012-02-20
    • 1970-01-01
    • 2016-12-28
    • 1970-01-01
    • 2013-03-31
    • 2012-12-16
    • 2016-06-01
    • 2021-01-16
    • 1970-01-01
    相关资源
    最近更新 更多