I'm using a webView in my Android app to load YouTube iframe player and auto play videos. It works fine on Samsung Galaxy S2 & S3, but when runs on Samsung Galaxy S4, it always results in gray screen when trying to auto play.
On Galaxy S4, it works fine without autoplay, needs user action(click) to start playing (Nothing happened if adding "autoplay:1" in playerVars).
I tried to call player.playVideo() in onPlayerReady(), it resulted in this gray screen:
The LogCat also shows a weird error message:
E/IMGSRV(17004): :0: GetPTLAFormat: Invalid format
when failed to autoplay. I don't know what this message is about; I've googled it and found nothing.
Here's the Android code of WebView:
WebView wv = (WebView) findViewById(R.id.webview);
WebSettings websettings = wv.getSettings();
websettings.setJavaScriptEnabled(true);
websettings.setDomStorageEnabled(true);
websettings.setDatabaseEnabled(true);
wv.loadUrl(strUrl);
wv.setWebViewClient(new WebViewClient());
wv.setWebChromeClient(new WebChromeClient());
wv.setPadding(0, 0, 0, 0);
wv.getSettings().setLoadWithOverviewMode(true);
wv.getSettings().setUseWideViewPort(true);
wv.setVerticalScrollBarEnabled(false);
wv.setHorizontalScrollBarEnabled(false);
Is this a known issue or if there's any solution to autoplay the video? Thanks!