2014-01-28 26 views
0

我不能重現的android web視圖中的音頻,僅適用於Android 4.4系統,該HTML代碼,例如:錯誤播放音頻在Android的WebView的HTML iframe中

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

第一個iframe中絲毫ivoox鏈接作品完美但所有其他iframe與uwhisp沒有工作。我可以點擊播放按鈕,但開始加載並永不結束。

我的WebView設置:

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

而且我把清單:

android:hardwareAccelerated="true" 

日誌貓把這個當我加載網頁內容:

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 

回答

1

這可能是URL重定向的問題。 MediaPlayer無法在此URL中正確訪問此文件。

試着把文件的原始位置放在href中。

+0

你的意思是把「https://uwhisp.com/w/lkn/」而不是「https://uwhisp.com/w/lkn/embed」? –

+0

更改那個不起作用 –

+1

問題是iframe的實現。 Android Web視圖無法訪問最終的音頻資源(由於重定向)「http://whisp-uwhisp-com.s3.amazonaws.com/9BN1LF.mp3?」。但是,其他iframe使用ajax連接來檢索音頻文件「http://www.ivoox.com/listenembeded_mn_2758812_1.m4a?source=EMBEDEDHTML5」。我不知道您是否可以修改iframe代碼,但是使用第一個iframe實現並使用第二個iframe音頻資源修改src,並正確播放音頻。 – jcmore2