package com.darktalker.cordova.viewportfix;

import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CallbackContext;
import org.json.JSONArray;
import org.json.JSONException;

import android.util.Log;



public class WebviewSetting extends CordovaPlugin {
    private CordovaWebView webView;
    @Override
    public void initialize(final CordovaInterface cordova, CordovaWebView webView) {
        Log.d("WebviewSetting", "set viewport");
        this.webView = webView;
        super.initialize(cordova, webView); 
        
    }
    @Override
    public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
        if ("set".equals(action)) {
            cordova.getActivity().runOnUiThread(new Runnable() {
                public void run() {
                    webView.getSettings().setLoadWithOverviewMode(true);
                    webView.getSettings().setUseWideViewPort(true);
                    
                    webView.getSettings().setMediaPlaybackRequiresUserGesture(false);
                    callbackContext.success();
                }
            });
            return true;
        }
        return false;  // Returning false results in a "MethodNotFound" error.
    }
}

@@ -267,16 +267,42 @@
 ption;%0A%0A
+import android.os.Build;%0A%0A
 import a
@@ -318,16 +318,16 @@
 il.Log;%0A
-
 %0A%0A%0Apubli
@@ -405,24 +405,84 @@
 ew webView;%0A
+    private static final String LOG_TAG = %22WebviewSetting%22;%0A
     @Overrid
@@ -582,32 +582,23 @@
   Log.d(
-%22WebviewSetting%22
+LOG_TAG
 , %22set v
@@ -1157,73 +1157,300 @@
     
-webView.getSettings().setMediaPlaybackRequiresUserGesture(false);
+if(Build.VERSION.SDK_INT %3E= Build.VERSION_CODES.JELLY_BEAN_MR1) %7B%0A            %09        webView.getSettings().setMediaPlaybackRequiresUserGesture(false);%0A            %09%0A            %09        Log.d(LOG_TAG, %22setMediaPlaybackRequiresUserGesture: FALSE%22);%0A                    %7D%0A                    
 %0A   

Update WebviewSetting.java