【问题标题】:Youtube url not working with android webviewYoutube url 不适用于 android webview
【发布时间】:2014-01-08 19:31:25
【问题描述】:

在我的混合基础 android 应用程序中,当我在 webview 中加载以下嵌入代码时,只有音频来并且屏幕显示空白屏幕,这里是 html 代码,

<tr>
 <td width="20%" class="dr"><strong>Wk 0 Tues</strong></td>
 <td width="40%">Three surprising reasons to pray</td>
 <td width="20%" > <a href="#this-video-1" id="video1" data-rel="popup" data-position-to="window"  data-transition="pop" style="color:#fff" >VIDEO</a></td>
</tr>
<div data-role="popup" id="this-video-1" data-overlay-theme="a" data-theme="c" data-dismissible="false" class="ui-content">
<a href="#" data-rel="back" data-role="button" data-theme="f" data-icon="delete" data-iconpos="notext" class="ui-btn-right" id='close1'>Close</a>
<div id="video-holder">
<object id="raj" width="100%"  height="250" type="text/html" data="http://www.youtube.com/embed/2qzxf0B0byA">Unable to play video. Please check your internet connection. 
</object>
</div>
</div>

同时显示音频和视频需要什么更改。

【问题讨论】:

    标签: android html webview


    【解决方案1】:

    调用 WebView.setWebChromeClient(new WebChromeClient());在您的 WebView 实例上。

    【讨论】:

    • 我做到了..但仍然只有音频不是视频
    • 您是否尝试过从 Chrom 浏览器应用程序加载相同的 HTML?
    • webView.getSettings().setPluginsEnabled(true) ?
    猜你喜欢
    • 1970-01-01
    • 2021-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-09
    • 2019-08-06
    • 2023-03-27
    相关资源
    最近更新 更多