1
爲什麼我不能正常播放該網站的視頻。我正在嘗試Webview
。什麼時候在VideoView
,視頻的作品,但不是我所需要的(沒有滾動條)。所以我試着用WebView
。此代碼顯示我的視頻,但不播放它。當我插入一個鏈接到我需要的網站時,我看到一個白色屏幕。也在電話上測試過。在manifest.xml
我給了互聯網許可。真的需要WebView的一些幫助
wv = (WebView) findViewById(R.id.webView);
wv.setWebChromeClient(new WebChromeClient());
wv.getSettings().setAllowFileAccess(true);
wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setPluginState(WebSettings.PluginState.ON);
wv.setWebViewClient(new WebViewClient());
wv.setBackgroundColor(0x00000000);
wv.getSettings().setBuiltInZoomControls(true);
String html = "<iframe width='420' height='345' src='http://m.ochepyatki.ru/video.php?vkey=be38112&f=11395221100' frameborder='0' allowfullscreen></iframe>";
wv.loadDataWithBaseURL(null, html, "text/html", "UTF-8", null);
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.MyParserIP"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="12"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:hardwareAccelerated="true">
<activity android:name="MyActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
不起作用