-
Notifications
You must be signed in to change notification settings - Fork 369
WEBRTC connection for SetWebChromeClient #13
Description
hello,
I stuck in my old version Android App based on Codova
I updated My Android App to latest version [email protected]
Now where i used CordovaWebView for Webview in my app as follows
<org.apache.cordova.CordovaWebView android:id="@+id/cordovaWebCallWebView" android:layout_width="match_parent" android:layout_height="match_parent" />
but it's not present in latest version of Cordova. So I changed to it by below lines
<org.apache.cordova.engine.SystemWebView android:id="@+id/SystemWebView" android:layout_width="match_parent" android:layout_height="match_parent" />
where i am using WebRtc for my App So I used following method of SystemWebView Class
`cwv.setWebChromeClient(new WebChromeClient() {
@Override
public void onPermissionRequest(final PermissionRequest request) {
javaToJavascript.webrtcCallLog("web.java", "permission asked is"+Arrays.deepToString(request.getResources()),0); //This logs the type of permission asked
Log.i("The list of permission asked is ", Arrays.deepToString(request.getResources())); // this askes for android.webkit.resource.AUDIO_CAPTURE permission
getActivity().runOnUiThread(new Runnable() {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void run() {
Log.i("Value Of the permission asked is ", request
.getOrigin().toString());
request.grant(request.getResources());
}
});
}
});
`
Now i got runtime error in my Main java file regarding classCastException
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.simCard.web/com.simCard.web.WebCall}: java.lang.ClassCastException: com.simCard.web.WebCall$1 cannot be cast to org.apache.cordova.engine.SystemWebChromeClient
How to solve This error ? Please any ones help will be grateful
Thank you