@@ -0,0 +1,2236 @@
+/*%0A * PhoneGap is available under *either* the terms of the modified BSD license *or* the%0A * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.%0A *%0A */%0A%0Apackage com.manu.videoplayer;%0A%0Aimport java.io.File;%0Aimport java.io.FileOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.net.URL;%0Aimport java.net.URLConnection;%0A%0Aimport org.json.JSONArray;%0Aimport org.json.JSONException;%0A%0Aimport android.content.Context;%0Aimport android.content.Intent;%0Aimport android.content.pm.PackageManager;%0Aimport android.net.Uri;%0A%0Aimport org.apache.cordova.CallbackContext;%0Aimport org.apache.cordova.CordovaPlugin;%0Aimport org.apache.cordova.PluginResult;%0A%0A%0Apublic class NewActivity extends CordovaPlugin %7B%0A    private static final String YOU_TUBE = %22youtube.com%22;%0A    private static final String ASSETS = %22file:///android_asset/%22;%0A%09%0A    @Override%0A    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) %7B%0A        PluginResult.Status status = PluginResult.Status.OK;%0A        String result = %22%22;%0A%0A        try %7B%0A            if (action.equals(%22playVideo%22)) %7B%0A                playVideo(args.getString(0),args.getInt(1),args.getInt(2));%0A            %7D%0A            else %7B%0A                status = PluginResult.Status.INVALID_ACTION;%0A            %7D%0A            callbackContext.sendPluginResult(new PluginResult(status, result));%0A        %7D catch (JSONException e) %7B%0A            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));%0A        %7D catch (IOException e) %7B%0A            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION));%0A        %7D%0A        return true;%0A    %7D%0A%0A    private void playVideo(String url,int width, int height) throws IOException %7B%0A%0A%09   %0A%09%09//Context context =  cordova.getActivity().getApplicationContext();%0A%09%09//Intent intent = new Intent(this.cordova.getActivity(),VideoActivity.class);%0A%0A%09%09//context.startActivity(intent);%0A%09%09%0A%09%09Intent intent = new Intent(cordova.getActivity(),VideoActivity.class);%0A%09%09intent.putExtra(%22WIDTH%22, width);%0A%09%09intent.putExtra(%22HEIGHT%22, height);%0A%09%09if (this.cordova != null) %7B%0A%09%09%09%09this.cordova.startActivityForResult((CordovaPlugin) this, intent, 0);%0A%09%09%09%7D%0A    %7D%0A%0A%7D%0A

Create NewActivity.java