【发布时间】:2020-01-11 11:43:12
【问题描述】:
我想将以下视频嵌入到 Android 网络视图中: https://www.espn.com.ar/core/video/iframe?id=6034792&endcard=false&omniReportSuite=wdgespg
我尝试了不同的网络视图方法,但没有任何结果。没有错误,我只能查看播放器但无法播放。
//清单:
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:hardwareAccelerated="true">
//代码:
String html = String.format("<iframe src=\"%s\" width=\"340\" height=\"313\" style=\"border:none;overflow:hidden\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\"></iframe>", url.getSrc());
wview.loadDataWithBaseURL("https://www.espn.com.ar", html, "text/html", "UTF-8", null);
//OR
wview.loadUrl(url.getSrc());
//MY WEBVIEW:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:wheel="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true">
<WebView
android:id="@+id/wview"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
【问题讨论】:
-
它是一个嵌入视频
标签: android video webview android-webview embed