简体   繁体   English

在html iframe中的Android Webview上播放音频时出错

[英]Error playing audio on Android webview inside html iframe

I can't reproduce audio inside a android webView, only works in android 4.4, the html code is for example: 我无法在android webView中再现音频,仅在android 4.4中有效,例如html代码:

<strong>Axel Torres</strong> ha entrevistado este sábado en &#8216;Marcador Internacional&#8217; en Radio Marca a <strong>Javier Clemente</strong>, <a href=\"http://www.marcadorint.com/etiqueta/libia/\">actual seleccionador de <strong><span class='wp_keywordlink_affiliate'><a href=\"http://www.marcadorint.com/etiqueta/libia/\" title=\"Ver todas las entradas en Libia\" target=\"_blank\">Libia</a></span></strong></a>. El técnico de Barakaldo ha tratado múltiples asuntos durante la hora en la que ha estado <strong>en los micrófonos de &#8216;MI&#8217;</strong>, incluyendo su visión del fútbol libio, su opinión sobre los tiempos modernos en el mundo del fútbol, su experiencia en Twitter o su polémica con <strong>Juan Carlos Garrido</strong>.</p>\n<p><iframe src=\"http://www.ivoox.com/player_ek_2758812_1.html\" height=\"48\" width=\"238\" allowfullscreen=\"\" frameborder=\"0\" scrolling=\"no\"></iframe></p>\n<p>Además de la entrevista completa, en &#8216;MI&#8217; recogemos algunos de los <strong>sonidos más <span class='wp_keywordlink_affiliate'><a href=\"http://www.marcadorint.com/etiqueta/destacado/\" title=\"Ver todas las entradas en destacado\" target=\"_blank\">destacado</a></span>s</strong> de la charla de Javi Clemente con Axel Torres.</p>\n<blockquote><p>&#8220;El año pasado en la liga española había un equipo que según los medios era el tercer equipo que mejor jugaba y estaba en la cola. ¿Cómo va a ser el que mejor fútbol hace si pierdes cada domingo? <strong>Es un fútbol que no es real</strong>&#8220;<strong>.</strong></p></blockquote>\n<p><iframe src=\"https://uwhisp.com/w/lkn/embed\" height=\"160\" width=\"100%\" frameborder=\"no\" scrolling=\"no\"></iframe></p>\n<blockquote><p>&#8221; La cuenta de Twitter es real. Por las tardes, que aquí hace mucho calor, no tengo nada que hacer, entro en <strong>Twitter</strong> y en algunas cosas me divierto&#8221;.</p></blockquote>\n<p><iframe src=\"https://uwhisp.com/w/lko/embed\" height=\"160\" width=\"100%\" frameborder=\"no\" scrolling=\"no\"></iframe></p>\n<blockquote><p>&#8220;Ahora ha salido lo de Twitter, que eso para mi es una bomba. Esto de Twitter es un chollo: escribir lo que yo quiero sobre lo que yo quiero. A mi me leen 11.000, si a ellos los leen un millón, ¿a mi me leen 11 millones?&#8221;</p></blockquote>\n<p><iframe src=\"https://uwhisp.com/w/lkp/embed\" height=\"160\" width=\"100%\" frameborder=\"no\" scrolling=\"no\"></iframe></p>\n<h5>Contestar a los que lo han despreciado y se han mofado de él:</h5>\n<p><iframe src=\"https://uwhisp.com/w/lkq/embed\" height=\"160\" width=\"100%\" frameborder=\"no\" scrolling=\"no\"></iframe></p>\n<blockquote><p>&#8220;Nos toman el pelo con la palabreja &#8216;coaching&#8217;. Es un invento, un camelo que no sirve para nada&#8221;.</p></blockquote>\n<p><iframe src=\"https://uwhisp.com/w/lkr/embed\" height=\"160\" width=\"100%\" frameborder=\"no\" scrolling=\"no\"></iframe></p>\n<blockquote><p>&#8220;No tengo ni idea [¿Hasta cuándo has firmado?]. Eso de firmar no sirve para nada. Igual no llego ni a la primera convocatoria, lo mismo te tienen tres meses que te tienen doce años. <strong>El 2017 está muy lejos</strong>, vamos a ir paso a paso&#8221;.</p></blockquote>\n<p><iframe src=\"https://uwhisp.com/w/lks/embed\" height=\"160\" width=\"100%\" frameborder=\"no\" scrolling=\"no\"></iframe></p>\n<blockquote><p>&#8220;No tiene nada que ver cómo los llamo yo [a los jugadores de Libia] y cómo se llaman ellos&#8221;.</p></blockquote>\n<p><iframe src=\"https://uwhisp.com/w/lkt/embed\" height=\"160\" width=\"100%\" frameborder=\"no\" scrolling=\"no\"></iframe></p>\n<blockquote><p>&#8220;Mañana jugamos contra &#8216;Buenas Noches&#8217;, que es <strong>Gabón</strong> en euskera&#8221;.</p></blockquote>\n<p><iframe src=\"https://uwhisp.com/w/lkm/embed\" height=\"160\" width=\"100%\" frameborder=\"no\" scrolling=\"no\"></iframe></p>\n<h5>Acerca de su polémica con Juan Carlos Garrido:</h5>\n<p><iframe src=\"https://uwhisp.com/w/lkl/embed\" height=\"160\" width=\"100%\" frameborder=\"no\" scrolling=\"no\"></iframe></p>\n<h5>Despedida de Javier Clemente:</h5>\n<p><iframe src=\"https://uwhisp.com/w/lkk/embed\" height=\"160\" width=\"100%\" frameborder=\"no\" scrolling=\"no\"></iframe></p>\n<h6>Foto de <span class='wp_keywordlink_affiliate'><a href=\"http://www.marcadorint.com/etiqueta/portada/\" title=\"Ver todas las entradas en portada\" target=\"_blank\">portada</a></span>: magharebia</h6>\n


<iframe src=\"http://www.ivoox.com/player_ek_2758812_1.html\"
   height=\"48\" width=\"238\" allowfullscreen=\"\" frameborder=\"0\" scrolling=\"no\">
</iframe>

<iframe src=\"https://uwhisp.com/w/lkn/embed\" height=\"160\" width=\"100%\" 
frameborder=\"no\" scrolling=\"no\"></iframe>

The first iframe whit ivoox link works perfectly but all the others iframes with uwhisp did't work. 第一个iframe whit ivoox链接可以正常运行,但其他所有带uwhisp的iframe均不起作用。 I can click on play button but start loading and never ends. 我可以单击“播放”按钮,但开始加载并且永远不会结束。

My WebView settings: 我的WebView设置:

    contentWV.setWebChromeClient(new WebChromeClient());
            contentWV.getSettings().setPluginState(PluginState.ON);
            contentWV.getSettings().setJavaScriptEnabled(true);
    contentWV.loadDataWithBaseURL("", content, "text/html", "UTF-8", "");

And I put in Manifest: 然后输入清单:

android:hardwareAccelerated="true" 

The log cat put this when I load the web content: 当我加载Web内容时,日志猫将其放置了:

01-28 11:27:08.695: D/MediaPlayer(3850): Couldn't open file on client side, trying server side
01-28 11:27:09.141: I/Web Console(3850):  [ 21.738s] [ima.gptproxy.GptProxy] Iframe event received on /whisp32/lkn/em with data: Name: gpt, Type: isGptPresent, Session: *, Data: {"scope":"proxy"}, Origin: https://s0.2mdn.net
01-28 11:27:09.141: I/Web Console(3850):  at https://s0.2mdn.net/instream/html5/ima3_debug.js:78
01-28 11:27:09.219: I/Web Console(3850):  [ 19.797s] [ima.gptproxy.GptProxy] Iframe event received on /whisp32/lkq/em with data: Name: gpt, Type: isGptPresent, Session: *, Data: {"scope":"proxy"}, Origin: https://s0.2mdn.net
01-28 11:27:09.219: I/Web Console(3850):  at https://s0.2mdn.net/instream/html5/ima3_debug.js:78
01-28 11:27:09.227: I/Web Console(3850):  [ 19.210s] [ima.gptproxy.GptProxy] Iframe event received on /whisp32/lkr/em with data: Name: gpt, Type: isGptPresent, Session: *, Data: {"scope":"proxy"}, Origin: https://s0.2mdn.net
01-28 11:27:09.227: I/Web Console(3850):  at https://s0.2mdn.net/instream/html5/ima3_debug.js:78
01-28 11:27:09.258: I/Web Console(3850):  [ 18.645s] [ima.gptproxy.GptProxy] Iframe event received on /whisp32/lkk/em with data: Name: gpt, Type: isGptPresent, Session: *, Data: {"scope":"proxy"}, Origin: https://s0.2mdn.net
01-28 11:27:09.258: I/Web Console(3850):  at https://s0.2mdn.net/instream/html5/ima3_debug.js:78
01-28 11:27:09.289: E/Web Console(3850): Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 at https://s-uwhisp-com.s3.amazonaws.com/js/whisp/77804ca82c6a34ef439246a06b891bddf268a337.js:292
01-28 11:27:09.367: I/dalvikvm(3850): Jit: resizing JitTable from 4096 to 8192
01-28 11:27:09.406: I/Web Console(3850):  [ 22.070s] [ima.gptproxy.GptProxy] Iframe event received on /whisp32/lkp/em with data: Name: gpt, Type: isGptPresent, Session: *, Data: {"scope":"proxy"}, Origin: https://s0.2mdn.net
01-28 11:27:09.406: I/Web Console(3850):  at https://s0.2mdn.net/instream/html5/ima3_debug.js:78
01-28 11:27:09.461: E/Web Console(3850): Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 at https://s-uwhisp-com.s3.amazonaws.com/js/whisp/77804ca82c6a34ef439246a06b891bddf268a337.js:292
01-28 11:27:09.523: I/Web Console(3850):  [ 22.184s] [ima.gptproxy.GptProxy] Iframe event received on /whisp32/lko/em with data: Name: gpt, Type: isGptPresent, Session: *, Data: {"scope":"proxy"}, Origin: https://s0.2mdn.net
01-28 11:27:09.523: I/Web Console(3850):  at https://s0.2mdn.net/instream/html5/ima3_debug.js:78
01-28 11:27:09.539: E/Web Console(3850): Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 at https://s-uwhisp-com.s3.amazonaws.com/js/whisp/77804ca82c6a34ef439246a06b891bddf268a337.js:292
01-28 11:27:09.594: I/Web Console(3850):  [ 18.120s] [ima.gptproxy.GptProxy] Iframe event received on /whisp32/lkm/em with data: Name: gpt, Type: isGptPresent, Session: *, Data: {"scope":"proxy"}, Origin: https://s0.2mdn.net
01-28 11:27:09.594: I/Web Console(3850):  at https://s0.2mdn.net/instream/html5/ima3_debug.js:78
01-28 11:27:09.625: I/Web Console(3850):  [ 17.708s] [ima.gptproxy.GptProxy] Iframe event received on /whisp32/lkt/em with data: Name: gpt, Type: isGptPresent, Session: *, Data: {"scope":"proxy"}, Origin: https://s0.2mdn.net
01-28 11:27:09.625: I/Web Console(3850):  at https://s0.2mdn.net/instream/html5/ima3_debug.js:78
01-28 11:27:09.648: I/Web Console(3850):  [ 17.536s] [ima.gptproxy.GptProxy] Iframe event received on /whisp32/lkl/em with data: Name: gpt, Type: isGptPresent, Session: *, Data: {"scope":"proxy"}, Origin: https://s0.2mdn.net
01-28 11:27:09.648: I/Web Console(3850):  at https://s0.2mdn.net/instream/html5/ima3_debug.js:78
01-28 11:27:09.680: I/Web Console(3850):  [  4.175s] [ima.gptproxy.GptProxy] Iframe event received on /whisp32/lks/em with data: Name: gpt, Type: isGptPresent, Session: *, Data: {"scope":"proxy"}, Origin: https://s0.2mdn.net
01-28 11:27:09.680: I/Web Console(3850):  at https://s0.2mdn.net/instream/html5/ima3_debug.js:78
01-28 11:27:10.031: E/Web Console(3850): Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 at https://s-uwhisp-com.s3.amazonaws.com/js/whisp/77804ca82c6a34ef439246a06b891bddf268a337.js:292
01-28 11:27:10.258: E/Web Console(3850): Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 at https://s-uwhisp-com.s3.amazonaws.com/js/whisp/77804ca82c6a34ef439246a06b891bddf268a337.js:292
01-28 11:27:10.547: E/Web Console(3850): Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 at https://s-uwhisp-com.s3.amazonaws.com/js/whisp/77804ca82c6a34ef439246a06b891bddf268a337.js:292
01-28 11:27:11.148: W/Web Console(3850):  [ 16.017s] [ima.common.GptCompanionAdService] GPT companion ads service not available.
01-28 11:27:11.148: W/Web Console(3850):  at https://s0.2mdn.net/instream/html5/bridge3.1.42_debug_en.html#goog_1706910922:238
01-28 11:27:12.086: W/Web Console(3850):  [ 15.944s] [ima.common.GptCompanionAdService] GPT companion ads service not available.
01-28 11:27:12.086: W/Web Console(3850):  at https://s0.2mdn.net/instream/html5/bridge3.1.42_debug_en.html#goog_574116096:238
01-28 11:27:12.141: W/Web Console(3850):  [ 15.273s] [ima.common.GptCompanionAdService] GPT companion ads service not available.
01-28 11:27:12.141: W/Web Console(3850):  at https://s0.2mdn.net/instream/html5/bridge3.1.42_debug_en.html#goog_385102197:238
01-28 11:27:12.180: W/Web Console(3850):  [ 14.785s] [ima.common.GptCompanionAdService] GPT companion ads service not available.
01-28 11:27:12.180: W/Web Console(3850):  at https://s0.2mdn.net/instream/html5/bridge3.1.42_debug_en.html#goog_333133509:238
01-28 11:27:12.242: W/Web Console(3850):  [ 13.004s] [ima.common.GptCompanionAdService] GPT companion ads service not available.
01-28 11:27:12.242: W/Web Console(3850):  at https://s0.2mdn.net/instream/html5/bridge3.1.42_debug_en.html#goog_2038632347:238
01-28 11:27:12.602: W/Web Console(3850):  [ 11.629s] [ima.common.GptCompanionAdService] GPT companion ads service not available.
01-28 11:27:12.602: W/Web Console(3850):  at https://s0.2mdn.net/instream/html5/bridge3.1.42_debug_en.html#goog_386198883:238
01-28 11:27:13.344: W/Web Console(3850):  [ 10.654s] [ima.common.GptCompanionAdService] GPT companion ads service not available.
01-28 11:27:13.344: W/Web Console(3850):  at https://s0.2mdn.net/instream/html5/bridge3.1.42_debug_en.html#goog_1680205568:238
01-28 11:27:13.531: W/Web Console(3850):  [  9.374s] [ima.common.GptCompanionAdService] GPT companion ads service not available.
01-28 11:27:13.531: W/Web Console(3850):  at https://s0.2mdn.net/instream/html5/bridge3.1.42_debug_en.html#goog_806220502:238
01-28 11:27:13.617: W/Web Console(3850):  [  8.185s] [ima.common.GptCompanionAdService] GPT companion ads service not available.
01-28 11:27:13.617: W/Web Console(3850):  at https://s0.2mdn.net/instream/html5/bridge3.1.42_debug_en.html#goog_158678934:238
01-28 11:27:14.172: W/Web Console(3850):  [  7.084s] [ima.common.GptCompanionAdService] GPT companion ads service not available.
01-28 11:27:14.172: W/Web Console(3850):  at https://s0.2mdn.net/instream/html5/bridge3.1.42_debug_en.html#goog_545018154:238

It could be a problem with the URL redirection. URL重定向可能是一个问题。 MediaPlayer can´t access correctly to this file in this URL. MediaPlayer无法在此URL中正确访问此文件。

Try to put in href the original location of file. 尝试将href放在文件的原始位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM