Hello, I ran into a problem. WebView does not load videos. That is, the layout comes up correctly and the video in the right place. But by clicking on the video, nothing happens. Did on guides.
In the manifest:
<activity android:name=".Activities.BlogsItem" android:hardwareAccelerated="true" android:screenOrientation="portrait" > </activity> In the layout there are a couple of views, buttons and roughly in the center of WebView, the script comes from the server, I put an example script:
<WebView android:id="@+id/webView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/relative" android:layout_marginTop="5dp" /> In activit:
String script = "Π²ΠΈΠ΄ΠΎΡΠ²ΠΈΠ΄ΠΎΡΠ²ΠΈΠ΄ΠΎΡΠ²ΠΈΠ΄ΠΎΡΠ²ΠΈΠ΄ΠΎΡΠ²ΠΈΠ΄ΠΎΡ\n" + "<br />Π²ΠΈΠ΄ΠΎΡ\n" + "<br />\n" + "<br />\n" + "<br /><video width=\"350.0\" controls=\"controls\"><source src=\"http://www.youtube.com/watch?v=YgmtS4n4ujY\" type=\"video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"></video>\n" + "<br />\n" + "<br />\n" + "<br />Π΄Π²Π° Π²ΠΈΠ΄ΠΎΡΠ°\n" + "<br />\n" + "<br /><video width=\"350.0\" controls=\"controls\"><source src=\"https://www.youtube.com/watch?v=X-4msD7eo0g\" type=\"video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"></video> <st yle>img{max-width:350.0px;!important} body{margin: 0; padding: 0}</style>"; WebView webView = (WebView) findViewById(R.id.webView); webView.setWebChromeClient(new WebChromeClient()); webView.setWebViewClient(new WebViewClient()); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); webView.getSettings().setPluginState(WebSettings.PluginState.ON); webView.getSettings().setPluginState(WebSettings.PluginState.ON_DEMAND); webView.loadDataWithBaseURL(null, script, "text/html; charset=utf-8", "UTF-8", null); here is the link to the blog http://justme.webformula.pro/personal/blog/first-blog/38/
in loadDataWithBaseURL () instead of null, I visited the insert link, no use.
Who faced such a problem please help !!!