package com.ccpony.avchat.peerconnection;

import java.util.HashMap;

import android.webkit.JavascriptInterface;

public class PCManager {
	HashMap<String, PCWrapper> pc_map = new HashMap<String, PCWrapper>();
	
	@JavascriptInterface
	public void create_pc(String pc_id) {
		PCWrapper pc_wrapper = new PCWrapper(null, null);
		pc_map.put(pc_id, pc_wrapper);
	}
	
	@JavascriptInterface
	public void add_stream(String pc_id) {
		PCWrapper pc_wrapper = pc_map.get(pc_id);
		pc_wrapper.addStream();
	}
}

@@ -63,16 +63,108 @@
 shMap;%0A%0A
+import org.json.JSONException;%0Aimport org.json.JSONObject;%0A%0Aimport android.util.JsonReader;%0A
 import a
@@ -198,16 +198,16 @@
 erface;%0A
-
 %0Apublic 
@@ -336,14 +336,11 @@
 oid 
-create
+add
 _pc(
@@ -459,32 +459,126 @@
 scriptInterface%0A
+%09public void remove_pc(String pc_id) %7B%0A%09%09pc_map.remove(pc_id);%0A%09%7D%0A%09%0A//%09@JavascriptInterface%0A//
 %09public void add
@@ -589,36 +589,54 @@
 eam(String pc_id
+, JSONObject obj
 ) %7B%0A
+//
 %09%09PCWrapper pc_w
@@ -667,34 +667,204 @@
 d);%0A
-%09%09pc_wrapper.addStream();%0A
+//%09%09String param = obj.toString();%0A//%09%09try %7B%0A//%09%09%09JSONObject res = new JSONObject(param);%0A//%09%09%7D catch (JSONException e) %7B%0A//%09%09%09// TODO Auto-generated catch block%0A//%09%09%09e.printStackTrace();%0A//%09%09%7D%0A//
 %09%7D%0A%7D

update pcmanager