Trying to play video in a WebView on Android. The video should play autoplay and inline with sound. But now image is shown.
Code from my NativeScript project:
if (platform.isAndroid) {
webView.android.setBackgroundColor(0x00000000);//android.graphics.Color.TRANSPARENT);//
webView.android.setLayerType(android.view.View.LAYER_TYPE_SOFTWARE, null);
} else if (platform.isIOS) {
webView.ios.scrollView.bounces = false;
webView.ios.scrollView.showsHorizontalScrollIndicator = false;
webView.ios.scrollView.showsVerticalScrollIndicator = false;
webView.ios.backgroundColor = UIColor.clearColor;
webView.ios.opaque = false;
// Stop zooming
webView.ios.scrollView.minimumZoomScale = 1.0;
webView.ios.scrollView.maximumZoomScale = 1.0;
webView.ios.scalesPageToFit = false;
webView.ios.scrollView.bounces = false;
}
As you can see I have done server settings for the iOS and it works great. Now I like to do the same for Android.
Please help!
best regards, /Erik
It did work if I change the line:
webView.android.setLayerType(android.view.View.LAYER_TYPE_SOFTWARE, null);
to:
webView.android.setLayerType(android.view.View.LAYER_TYPE_HARDWARE, null);
User contributions licensed under CC BY-SA 3.0