【发布时间】:2026-02-10 09:35:01
【问题描述】:
我正在尝试使用 PhoneRTC 在 Worklight 中实现视频聊天。首先,我将 Java 文件添加到我的 Worklight 应用程序中,并将该功能添加到我的 config.xml 中。问题是当我在main.js 中使用PhoneRTC 函数时,我在转换Converting circular structure to JSON .. 时遇到错误
这是我的main.js
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");
}
} ]);
}
这是完整的项目:https://mega.co.nz/#!gsAXga6L!Rc7yJDzj5GhQA-8gV45gFHFk3jPGmmRN0j5gV3ZihRw
【问题讨论】:
-
重复代码有什么原因吗?
-
很抱歉,这只是一个错误。你能帮我集成phonertc,并在我的worklight应用程序中调用他的函数
-
代码不包含任何可调试的内容 - 提供您的 Worklight 项目。
-
这是我的工作灯项目,感谢您的帮助 idan mega.co.nz/…
-
项目包含错误:项目 'ChatPeerToPeerAndroid' 缺少必需的库:'C:/Users/gara/Desktop/phonertc-master/libs/android/libjingle_peerconnection.jar' - 提供缺少的 JAR。
标签: javascript ibm-mobilefirst cordova-plugins phonertc