Javascript 将PhoneRTC与Worklight一起使用
我正在尝试使用PhoneRTC在Worklight中实现视频聊天。首先,我将Java文件添加到Worklight应用程序中,并在config.xml中添加该功能。问题是,当我在main.js中使用PhoneRTC函数时,将循环结构转换为JSON时会出现错误 这是我的main.jsJavascript 将PhoneRTC与Worklight一起使用,javascript,ibm-mobilefirst,cordova-plugins,phonertc,Javascript,Ibm Mobilefirst,Cordova Plugins,Phonertc,我正在尝试使用PhoneRTC在Worklight中实现视频聊天。首先,我将Java文件添加到Worklight应用程序中,并在config.xml中添加该功能。问题是,当我在main.js中使用PhoneRTC函数时,将循环结构转换为JSON时会出现错误 这是我的main.js 以下是完整的项目:在Worklight 6中,与第三方Cordova插件集成非常困难,不能保证成功 但是,在MobileFirst 7.1中,您现在可以创建纯Cordova应用程序,其中提供的SDK是Cordova插件
以下是完整的项目:在Worklight 6中,与第三方Cordova插件集成非常困难,不能保证成功 但是,在MobileFirst 7.1中,您现在可以创建纯Cordova应用程序,其中提供的SDK是Cordova插件,基本上解除了Worklight混合应用程序体系结构之前施加的任何限制 使用更新的应用程序模型,或者更确切地说,standard now,您可以简单地按照PhoneRTC的说明将PhoneRTC Cordova插件安装到Cordova应用程序中
请在此处阅读更多信息:代码重复的原因是什么?很抱歉,这只是一个错误。你能帮我集成phonertc并在我的worklight应用程序中调用他的函数时遇到问题吗?代码不包含任何可以调试的内容-请提供你的worklight项目。这是我的worklight项目,感谢您的帮助,因为该项目包含错误:项目“ChatPeerToPeerAndroid”缺少必需的库:“C:/Users/gara/Desktop/phonertc master/libs/android/libjingle_peerconnection.jar”-提供缺少的jar。
function wlCommonInit() {
}
var config = {
isInitiator : true,
stun : {
url : 'stun:stun.l.google.com:19302'
},
streams : {
audio : true,
video : false
}
}
var parameters = {
container : $('#videoContainer'),
local : {
position : [ 0, 0 ],
size : [ 100, 100 ]
}
};
function launch() {
if (WL.Client.getEnvironment() == WL.Environment.PREVIEW) {
WL.SimpleDialog
.show(
"Cordova Plugin",
"Please run the sample in either a Simulator/Emulator or physical device to see the response from the Cordova plug-in.",
[ {
text : "OK",
handler : function() {
WL.Logger.debug("Ok button pressed");
}
} ]);
} else {
cordova.exec(RTCSuccess, RTCFailure, "PhoneRTCPlugin", "setVideoView",parameters);
}
}
function RTCSuccess(data) {
WL.SimpleDialog.show("Response from plug-in", data, [ {
text : "OK",
handler : function() {
WL.Logger.debug("Ok button pressed");
}
} ]);
}
function RTCFailure(data) {
WL.SimpleDialog.show("Response from plug-in", data, [ {
text : "OK",
handler : function() {
WL.Logger.debug("Ok button pressed");
}
} ]);
}