Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Arif_B_
Beginner
448 Views

Method to Load a web URL in crosswalk webview

 

Hi,

I would like to use the crosswalk webview to load an external webRTC application website URL, currently I am using the inAppBrowser with window.open(https://www.zrg.com/mobiconnect"), but this is loading the page in the internal android webview.. 

Kindly let me know the exact method of using the crosswalk webview and loading the external url's.

What other plugins are required?

How can I check if the page is using a crosswalk webview?

Thanks & Regards

Arif

Tags (2)
0 Kudos
20 Replies
Pamela_H_Intel
Moderator
414 Views

Arif,

Take a look at this sample: https://github.com/gomobile/sample-webrtc-video-client

Pamela

Pamela_H_Intel
Moderator
414 Views

The article referenced in Github must have moved. This might be the right one. I am checking with Elroy.

https://software.intel.com/en-us/xdk/article/webrtc-client-on-mobile-server-implementation

 

Arif_B_
Beginner
414 Views

Ok Thanks for the information, let me try this and check if the issue persist then I will revert back

 

Regards

Arif

Arif_B_
Beginner
414 Views

Dear Pamela,

I have check the document and downloaded the sample, however this sample is quite old and no more compliant with the new version of XDK...

I am getting an error on the following line: var socket = io.connect

Kindly check if there is any updated code available for the current release and what action needs to be taken for web socket connectivity.

Thanks

Regards

Arif

 

Pamela_H_Intel
Moderator
414 Views

Arif,

Bit6 has published a nice tutorial just today showing how to incorporate their Bit6 plugin for WebRTC using XDK. I have not tried it myself yet, but maybe it will help you. Here is the link: http://docs.bit6.com/start/cordova-xdk/

Swati_S_Intel1
Employee
414 Views

@Arif, Please use target as '_blank' with window.open. This will open an inAppBrowser instance which will be running in the crosswalk webview if your app is built with Crosswalk. You haven't specified target and it defaults to '_self'.

Use:

window.open(URL, '_blank', 'location=no');

 

PaulF_IntelCorp
Employee
414 Views

Also, I highly recommend you call the inappbrowser API directly and not use the shadowed window.open function, that will go away and cause errors in future versions. See the docs here > https://github.com/apache/cordova-plugin-inappbrowser

Arif_B_
Beginner
414 Views

Hi,

OK I will replace this with the inAppBrowser API call cordova.InAppBrowser.open 

Will feedback with the results.

Regards

Arif
 

Arif_B_
Beginner
414 Views

Hi there, Pls see the feedback.

Following is the mobile responsive website I want to access from android device (Samsung S7 and Note 4):

Website URL: https://www.zrg.com/mobiconnect

Login: ABC 

Password: 123

The web site is successfully working in Android Chrome browser Ver 48.0 & 49.0

In XDK I have taken a new Android CrossWalk project of inAppBrowser template and used the inAppBrowser API call as per your recommendation as follows:

var ref = cordova.InAppBrowser.open('https://www.zrg.com/mobiconnect', '_blank', 'location=no');

The webview is loading the above website in the Emulation mode successfully and has no issues, however once I am loading it into Android Device I am facing an issue, once the login name and password is entered there is an error generated,

Failed to get access to local media Error: user media access fail.

I have taken few other plug-ins for permissions like the Camera, Capture and Media for GetUserMedia permissions, but it did not help.

Kindly assist

Regards

Arif

 

 

 

PaulF_IntelCorp
Employee
414 Views

Not knowing what is on that page (https://www.zrg.com/mobiconnect/) that you are trying to open in the app, it's hard to say what permissions are needed or why you are getting the error. You can add Android permissions, manually, on the Build Settings section of the Projects tab. Have you confirmed that you have your whitelist settings correctly configured (also on the build settings section)? When you open as you have done (_blank) you are opening in the context of the containing app's webview. I recommend that you do this with Crosswalk, unless you are limiting your app to use on Android 5+ devices.

Arif_B_
Beginner
414 Views

Hi there,

I have now taken the html/css/javascript website code and complied a local application in XDK which is working OK, however I am having an issue accessing my mobile phones camera/microphone, it seems that  "getUserMedia" api function is not working on my Android device and require some extra permissions to access the media devices.

I have already taken the following plugins in the project:

Camera, Capture, Device, Media

I have tried to give manual permissions in the setting tab as CAMERA; but did not help.

Is there any other plugin or permissions required to enable the getUserMedia to access my phones camera/microphone?

Please note that the same code is running fine in Chrome & Firefox browsers for android 5+.

Kindly assist.

Regards

Arif

PaulF_IntelCorp
Employee
414 Views

getUserMedia is a deprecated navigator API, it is not part of those plugins. Please see the plugin docs for their respective APIs. Also, the plugins will automatically provide the proper Android permissions, so there's nothing for you to do there.

For example, for the Cordova Media plugin > https://github.com/apache/cordova-plugin-media

Pamela_H_Intel
Moderator
414 Views

Arif - have you had luck with the plugin APIs? As Paul says, getUserMedia is a web API, not a mobile API, and it is deprecated. The plugin APIs will serve you better for mobile apps.

Arif_B_
Beginner
414 Views

 

Hi

I was able to find one cordova webrtc Plugin, 

https://github.com/remotium/cordova-plugin-webrtc

but unfortunately this is only for iOS6 and not available for Android yet.

I would appreciate if you can point out for any possible plugin...

Regards

Arif

PaulF_IntelCorp
Employee
414 Views

Arif -- WebRTC is supported without the need for plugins if you enable Crosswalk on Android. See the Crosswalk doc pages in the Intel XDK doc site.

Arif_B_
Beginner
414 Views

 

Yes, I have enabled the crosswalk but I am having problems in getting the camera access... although I have enabled the CAMERA; and RECORD_AUDIO permissions.

Arif

Arif_B_
Beginner
414 Views

By the way the sample webrtc application that comes with XDK is also not getting the camera access, I saw the code and it is also using the getusermedia api...

                navigator.getUserMedia(constraints, handleUserMedia, handleUserMediaError);

 

Arif

Arif_B_
Beginner
414 Views

 

Hi,

My webRTC issue for Android/Crosswalk is finally resolved... thanks for all the support...

CAMERA;RECORD_AUDIO;MODIFY_AUDIO_SETTINGS; in build settings permissions need to be set.

Now I am moving towards iOS compliance, do I have follow any special instructions on this or WKWebview plugin will do the job?

Thanks

Regards

Arif

PaulF_IntelCorp
Employee
414 Views

I doubt you will need the WKWebView plugin for iOS for this app. I would try first without and only add that plugin if the performance is inadequate.

krishna_y_
Beginner
51 Views

hello everybody i'm newbie , i got some question,how can i build  webview inside page with header and menu

thx...

Reply