YouTube embedded video won't show fullscreen button in webview - android

I am new to Android development and I am trying to make an app for my video website which has videos from YouTube.
The problem I am having right now is that the embedded iframe videos don't show the fullscreen button. I have been searching for a solution but have yet to find one that works for me.
mainActivity.java:
public class MainActivity extends Activity {
private WebView wv1;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mWebView = (WebView) findViewById(R.id.webView);
WebView myWebView = (WebView) findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
wv1=(WebView)findViewById(R.id.webView);
wv1.setWebChromeClient(new WebChromeClient() {
});
wv1.setWebViewClient(new MyBrowser());
wv1.loadUrl("http://m.youtube.com");
} .....
Thanks for any help.

Related

Why can't my android webview load JavaScript

I want to load a login page with JavaScript but I couldn't get the JavaScript to load even though i made a setJavaScriptEnabled(true)
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webView = (WebView) findViewById(R.id.webview);
WebSettings webSettings = webView.getSettings();
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("https://itsikkerhed.talentlms.com/index");
}
Try to enable DomStorage: webView.getSettings().setDomStorageEnabled(true);

Android Studio - Video Volume Low

I have taken a web page which has several videos that show in modals and put it in a WebView. When I open this page on my laptop I get full volume. When I launch the app and try to view the video I don't see video controls and the sound on the tablet is turned all the way up, yet it is very quiet. What am I missing here?
The WebView
public class MainActivity extends AppCompatActivity {
private WebView webView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webView=findViewById(R.id.webviewid);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setBuiltInZoomControls(true);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("file:///android_asset/index.html");
}
}
Turn JavaScript On for the WebView.
mWebView.getSettings().setJavaScriptEnabled(true);

Why my html file is not displayed in android application?

When I build and run the application I see only black screen,The html file is using java script,video,audio file and images,I used these codes
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView webView = (WebView) findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebChromeClient(new WebChromeClient());
webView.loadUrl("file:///android_asset/aici/index.html");
}

Integrating Google Forms in Android WebView, SignIn button not working

I am working on my first android project which is based on Google Forms.
I've done pretty much everything except my main part which is showing forms in webview. The form is getting display but the Sign In button is not clickable.
public class cadexpo extends AppCompatActivity {
private static WebView browser;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cadexpo);
browser = (WebView) findViewById(R.id.webView);
browser.getSettings().getJavaScriptEnabled();
WebSettings browser = browser.getSettings();
browser.loadUrl("https://drive.google.com/open?id=1VLKIncq9bTJnWqxbOHc3foTeSLykP7AQyL0Si1cIQ1I");
Please help me in fixing it.
Enable javascript for webview
WebSettings webSettings = browser.getSettings();
webSettings.setJavaScriptEnabled(true);

My first android app.. custom css

I'm trying to make an app with a webview of facebook.com, i want to load custom css but i don't know how. I searched on Google but found old tutorials and i read that it has changed in Android Studio 2.0
Here is my code:
private WebView myWebView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myWebView = (WebView)findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.loadUrl("https://www.facebook.com/");
myWebView.setWebViewClient(new WebViewClient());
}

Categories

Resources