| 
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -20,6 +20,7 @@ import io.flutter.plugins.GeneratedPluginRegistrant
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler, VideoCallResponseListener {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    private val CHANNEL = "Dr.cloudSolution/videoCall"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    private lateinit var methodChannel: MethodChannel
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    private var result: MethodChannel.Result? = null
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    private var call: MethodCall? = null
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    private val LAUNCH_VIDEO: Int = 1
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -29,15 +30,10 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        GeneratedPluginRegistrant.registerWith(flutterEngine)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler(this)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        methodChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        methodChannel.setMethodCallHandler(this)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    override fun onCreate(savedInstanceState: Bundle?) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        super.onCreate(savedInstanceState)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        this.result = result
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -67,7 +63,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            "closeVideoCall" -> {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                dialogFragment?.onCallClicked()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            "onCallConnected"->{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            "onCallConnected" -> {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            else -> {
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -87,7 +83,7 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				//        intent.putExtra("sessionStatusModel", sessionStatusModel)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				//        startActivityForResult(intent, LAUNCH_VIDEO)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if (dialogFragment == null){
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if (dialogFragment == null) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val arguments = Bundle()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            arguments.putString("apiKey", apiKey)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            arguments.putString("sessionId", sessionId)
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -103,47 +99,47 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                it.isCancelable = true
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                it.show(transaction, "dialog")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        } else if (!dialogFragment!!.isVisible){
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        } else if (!dialogFragment!!.isVisible) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val transaction = supportFragmentManager.beginTransaction()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            dialogFragment!!.show(transaction, "dialog")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				   /* override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        super.onActivityResult(requestCode, resultCode, data)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        var asd = "";
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if (requestCode == LAUNCH_VIDEO) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            if (resultCode == Activity.RESULT_OK) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                val result  : SessionStatusModel? = data?.getParcelableExtra("sessionStatusNotRespond")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                val callResponse : HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    /* override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				         super.onActivityResult(requestCode, resultCode, data)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				         var asd = "";
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				         if (requestCode == LAUNCH_VIDEO) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				             if (resultCode == Activity.RESULT_OK) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 val result  : SessionStatusModel? = data?.getParcelableExtra("sessionStatusNotRespond")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 val callResponse : HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                val sessionStatus : HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                val gson = GsonBuilder().serializeNulls().create()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 val sessionStatus : HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 val gson = GsonBuilder().serializeNulls().create()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                callResponse["callResponse"] = "CallNotRespond"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                val jsonRes = gson.toJson(result)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                callResponse["sessionStatus"] = jsonRes
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 callResponse["callResponse"] = "CallNotRespond"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 val jsonRes = gson.toJson(result)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 callResponse["sessionStatus"] = jsonRes
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                this.result?.success(callResponse)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            if (resultCode == Activity.RESULT_CANCELED) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                val callResponse : HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                callResponse["callResponse"] = "CallEnd"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 this.result?.success(callResponse)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				             }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				             if (resultCode == Activity.RESULT_CANCELED) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 val callResponse : HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 callResponse["callResponse"] = "CallEnd"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                result?.success(callResponse)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }*/
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                 result?.success(callResponse)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				             }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				         }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				     }*/
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    override fun onCallFinished(resultCode: Int, intent: Intent?) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        dialogFragment = null
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if (resultCode == Activity.RESULT_OK) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val result  : SessionStatusModel? = intent?.getParcelableExtra("sessionStatusNotRespond")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val callResponse : HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val result: SessionStatusModel? = intent?.getParcelableExtra("sessionStatusNotRespond")
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val callResponse: HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val sessionStatus : HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val sessionStatus: HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val gson = GsonBuilder().serializeNulls().create()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            callResponse["callResponse"] = "CallNotRespond"
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -152,9 +148,8 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            this.result?.success(callResponse)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        } else if (resultCode == Activity.RESULT_CANCELED) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val callResponse : HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            val callResponse: HashMap<String, String> = HashMap()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            callResponse["callResponse"] = "CallEnd"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            result?.success(callResponse)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -164,5 +159,12 @@ class MainActivity : FlutterFragmentActivity(), MethodChannel.MethodCallHandler,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				//        Toast.makeText(this, message, Toast.LENGTH_LONG).show()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    override fun minimizeVideoEvent(isMinimize: Boolean) {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if (isMinimize)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            methodChannel.invokeMethod("onCallConnected", null)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        else
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            methodChannel.invokeMethod("onCallDisconnected", null)
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
					 | 
				
			
			 | 
			 | 
			
				
 
 |