2016-12-02 4 views
3

Ich habe so etwas in meinem cordova appWebRTC in cordova webview

document.addEventListener("deviceready", onDeviceReady, false); 

function onDeviceReady() { 
     window.location.href = 'https://mobile.xxx.com';      
} 

Jetzt brauche ich WebRTC auf dieser Website zu nutzen. Und funktioniert gut, wenn ich es im mobilen Browser (Chrome 54.0.2840.85) ausführen.

Allerdings, wenn ich die apk verwende, lädt das Webview nicht die webRTC-Funktionen wie Kamera oder Mikro.

Also, im mobilen Browser funktioniert es gut, in Webview wird die RTK nicht funktionieren.

Dies ist, was ich in config.xml habe versucht

<content src="index.html" /> 

<access origin="https://mobile.xxx.com" /> 
<allow-navigation href="https://mobile.xxx.com" /> 
<allow-intent href="https://mobile.xxx.com" /> 

<plugin name="cordova-plugin-network-information"  version="1.3.0"  source="npm" /> 
<plugin name="cordova-plugin-splashscreen"    version="4.0.0"  source="npm" /> 
<plugin name="cordova-plugin-whitelist"     version="1.3.0"  source="npm" /> 
<plugin name="cordova-plugin-dialogs"     version="1.3.0"  source="npm" /> 
<plugin name="cordova-plugin-statusbar"     version="2.2.0"  source="npm" /> 

<preference name="StatusBarOverlaysWebView" value="false" /> 
<preference name="phonegap-version"   value="cli-6.3.0" /> 
<preference name="permissions"    value="none"/> 
<preference name="target-device"    value="universal"/> 
<preference name="fullscreen"     value="true"/> 
<preference name="show-splash-screen-spinner" value="true" /> 
<preference name="stay-in-webview"   value="true" />  
<preference name="orientation"   value="portrait" /> 
<preference name="loadUrlTimeoutValue"  value="700000" /> 

Bereits crosswalk aber gleiches Problem. Wie kann ich in cordova webview webrtc haben? Zur Klarstellung suche ich nur nach einer funktionalen Demo.

+0

Welche Version von Crosswalk hast du benutzt? – johnborges

+0

@johnborges bereits mit '' '' '' und mit '' '' ' – user455318

Antwort

0

Ich bin mir nicht sicher, welche WebRTC-spezifischen Funktionen Sie verwenden, aber es wird noch nicht vollständig für die meisten mobilen Browser unterstützt. Siehe here.

+0

Wie gesagt, Kamera/Mikro. – user455318

0

Soweit ich aus https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Taking_still_photos, verstanden Medien zugreifen sollen wir navigator.mediaDevices.getUserMedia

Ebenso für mobile app machen, müssen Sie die Berechtigungen in config.xml angeben, Kamera oder ein Mikrofon im Zusammenhang, den Sie verwenden .

Für Journalisten Zugang

<plugin name="cordova-plugin-media-capture" spec="1.4.0"> 
    <variable name="CAMERA_USAGE_DESCRIPTION" value="To take videos"/> 
    <variable name="MICROPHONE_USAGE_DESCRIPTION" value="To record voice while taking videos"/> 
    <variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="To provide photo browsing."/> 
</plugin> 

Für Zugriff auf die Kamera

<plugin name="cordova-plugin-camera" spec="2.3.0"> 
    <variable name="CAMERA_USAGE_DESCRIPTION" value="To take photos"/> 
</plugin> 

Weitere Details der oben genannten Plugins in der mobilen App finden: https://github.com/apache/cordova-plugin-camera
https://github.com/apache/cordova-plugin-media-capture

+0

Danke, aber selbst damit bin ich nicht mehr aktiv. '' 'stream.oninactive = function() { console.log ('Stream inaktiv'); }; '' ' – user455318