Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppRTC android crosswalk

I am trying to run the AppRTC HTML5 demo with Crosswalk on Android. But for some reason I can't get the microphone to work.

I have got the AppRTC HTML5 demo source from GitHub and followed the instructions to build. Once complete I have used the Chrome app output generated and edited the appwindow.html file to include cordova.js, and fix the paths for included files.

Finally I build using Cordova with crosswalk plugin (using the cordova build command). The app works and connects to the server the video works great, receiving audio from a PC is great but the audio from mobile device is not sent. I am not sure what is wrong, please help get the audio fixed.

Below is the Cordova config file.

config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.test.xapprtc" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>xAppRtc</name>
    <description>
        AppRTC on crosswalk.
    </description>
    <author email="[email protected]" href="http://test.com">
        Test
    </author>
    <content src="appwindow.html" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="Orientation" value="portrait" />
    <preference name="EnableViewportScale" value="true" />
    <preference name="StatusBarOverlaysWebView" value="false" />
    <plugin name="cordova-plugin-whitelist" version="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <feature name="Camera">
      <param name="android-package" value="org.apache.cordova.CameraLauncher" />
    </feature>
    <feature name="Capture">
      <param name="android-package" value="org.apache.cordova.Capture" />
    </feature>

</widget>
like image 284
PU2014 Avatar asked Dec 25 '22 18:12

PU2014


2 Answers

To access phone resources you have to declare it on the AndroidManifest.xml, so the final user knows it when installs the app.

Cordova and Crosswalk plugin build an application, even if you are not using crosswalk as a webview library, so you have to ask for permission in the manifest.

Guidelines are the same as for the embedding version: https://crosswalk-project.org/documentation/embedding_crosswalk.html

for microphone and camera the permissions are:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

but it seems that the plugin also does some tricks and needs one more:

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
like image 180
gaugeinvariante Avatar answered Dec 30 '22 09:12

gaugeinvariante


Have you tried to add manually the needed permissions to AndroidManifest.xml? Permission to get audio from mic is:

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
like image 37
beaver Avatar answered Dec 30 '22 09:12

beaver