Youtubeandroidplayerapi.jar Download ((free)) Link

dependencies implementation files('libs/YouTubeAndroidPlayerApi.jar') // other dependencies

private void loadYouTubeVideo(String videoId) WebView webView = findViewById(R.id.youtube_webview); webView.getSettings().setJavaScriptEnabled(true); webView.setWebChromeClient(new WebChromeClient()); // Enables fullscreen webView.getSettings().setMediaPlaybackRequiresUserGesture(false); String frame = "<!DOCTYPE html><html><body style=\"margin:0; padding:0\">" + "<iframe id=\"player\" type=\"text/html\" width=\"100%\" height=\"100%%\" " + "src=\"https://www.youtube.com/embed/" + videoId + "?enablejsapi=1&autoplay=0\" " + "frameborder=\"0\" allowfullscreen></iframe></body></html>"; webView.loadDataWithBaseURL("https://www.youtube.com", frame, "text/html", "UTF-8", null); youtubeandroidplayerapi.jar download