2016-11-10 6 views
2

私は自分のアプリケーションでwebviewを使用しています。ここで私はオーディオURLを与えています。Android WebViewはデフォルトのオーディオプレーヤーのサイズを変更します

一部のデバイスでは、その動作は全く問題ありません。スクリーンショットの下に以下を参照してください

here is the screenshot

しかし、いくつかのデバイスにそのユーザーフレンドリー見ていません。

webview 1

webview 2

WebViewのオーディオプレーヤーのサイズを設定する方法はありますか?

更新:コードスニペット:podcastListingFragmentから呼び出され

//オープンDOI活動

Intent podcastIntent = new Intent(mContext, DoiWebActivity.class); 
podcastIntent.setAction(Constants.INTENT_VIEW_LINK); 
podcastIntent.putExtra(Constants.EXTRA_DOI_LINK_URL, podcasts.get(0).getPodcastLink()); 
     podcastIntent.putExtra(Constants.CALLING_FRAGMENT,Constants.CALLING_FRAGMENT_PODCAST_LISTING); 
     podcastIntent.putExtra(Constants.EXTRA_PODCAST_NAME,mContext.getString(R.string.podcast)); 

mContext.startActivity(podcastIntent); 

//:ポッドキャスト名

 if (bundle != null && bundle.containsKey(Constants.CALLING_FRAGMENT) && 
       bundle.containsKey(Constants.EXTRA_PODCAST_NAME)) { 

String title = bundle.getString(SilverChairConstants.EXTRA_PODCAST_NAME); 

      } 
if (Utility.isNetworkAvailable(mActivity)) { 
      /** 
      * Showing external link. 
      */ 
      mWebView.loadUrl(mIntentText); 

     } else { 

      networkNotAvailable(); 

     } 

のxml:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@android:color/white" 
    tools:context=".fragments.WebFragment"> 

    <WebView 
     android:layout_below="@+id/toolbar" 
     android:id="@+id/wv_webcontainer" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 

    <!--progress bar--> 
    <include layout="@layout/silverchair_progress" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignTop="@id/wv_webcontainer" 
     android:layout_alignBottom="@id/wv_webcontainer"/> 


    <include layout="@layout/empty_view" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:layout_centerInParent="true" 
     /> 

</RelativeLayout> 
+0

はコードスニペットを共有します –

+0

が追加されました。 @VikashKumarVerma – Sangeeta

+0

にwebviewとそのレイアウトに関するコードを書いてください。 –

答えて

0

追加このあなたのWebviewを初期化しているあなたのコードの行。 mWebView.getSettings().setPluginState(WebSettings.PluginState.ON);

既にこれを行っている場合は、メディアプレーヤを使用してストラミングすることをおすすめします。

MediaPlayerストリーミングの詳細については、answerを参照してください。

関連する問題