Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
全屏Webview视频android_Android_Video_Webview - Fatal编程技术网

全屏Webview视频android

全屏Webview视频android,android,video,webview,Android,Video,Webview,我知道有人问webView问题。我的问题是,我想我的视频失真,以适应屏幕。我遇到的问题是视频保持其纵横比,因此对于屏幕来说太大或太小。我希望我的视频正好适合屏幕的边缘 webView.getSettings().setMediaPlaybackRequiresUserGesture(false); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setBuiltInZoomControls(false

我知道有人问webView问题。我的问题是,我想我的视频失真,以适应屏幕。我遇到的问题是视频保持其纵横比,因此对于屏幕来说太大或太小。我希望我的视频正好适合屏幕的边缘

webView.getSettings().setMediaPlaybackRequiresUserGesture(false);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setBuiltInZoomControls(false);
webView.getSettings().setSaveFormData(true);
webView.getSettings().setPluginState(WebSettings.PluginState.ON);
webView.getSettings().setDomStorageEnabled(true);
webView.setPadding(0, 0, 0, 0);
webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.setInitialScale(getScale());
webView.loadUrl(getConnectionUrl());
//set the layout width
getScreenDimensions();

//set webview orientation
webView.getLayoutParams().height = (int)mHeight;
webView.getLayoutParams().width = (int)mWidth;

网络视图中的视频是一个坏主意。是否有其他方法可以使用,问题是我需要从网页加载图像和视频。这应该没有问题。根据您的视图/库,您只需输入正确的url即可。@rekire视频加载正常,问题在于如何缩放它以适应屏幕。目前,视频不会丢失纵横比,我需要它能够扭曲自身以适应屏幕。老实说,我从未使用过WebView(admob除外),所以我不知道。在WebView中播放视频是个坏主意。我可以使用其他方法吗,问题是我需要从网页加载图像和视频。这应该没有问题。根据您的视图/库,您只需输入正确的url即可。@rekire视频加载正常,问题在于如何缩放它以适应屏幕。目前视频不会丢失纵横比,我需要它能够扭曲自己以适应屏幕。老实说,我从未使用过WebView(admob的一部分除外),所以我不知道它。