我正在尝试使用Linphone在我的swift应用上启用视频通话。 我能够启用音频通话,但我无法使用视频。如果我启用此行,应用程序将始终崩溃:
linphone_call_params_enable_video(linCallParams, 1)
我想在这里只接收视频和音频。
@objc func startVideoCall() {
linphone_core_enable_video_display(theLinphone.lc, 1)
linphone_core_enable_video_capture(theLinphone.lc, 1)
let linCallParams = linphone_core_create_call_params(theLinphone.lc, nil)
linphone_call_params_enable_video(linCallParams, 1)
linphone_call_params_set_video_direction(linCallParams, LinphoneMediaDirectionSendRecv)
linphone_call_params_set_audio_direction(linCallParams, LinphoneMediaDirectionSendRecv)
let call = linphone_core_invite_with_params(theLinphone.lc, calleeAccount, linCallParams)
linphone_core_set_native_video_window_id(theLinphone.lc, &videoStreamView)
linphone_core_set_native_preview_window_id(theLinphone.lc, &videoStreamPreview)
do {
try audioSession.setActive(true)
} catch {
print("Audio error: \(error.localizedDescription)")
}
linphone_call_params_unref(linCallParams)
}
答案 0 :(得分:1)
此代码组合修复了我的问题
var data = {ListofLayers: '[{"Key":"G1","Value":"park"}]'};
var JSONObject = JSON.parse(JSON.stringify(data));
var obj = JSON.parse(Object.values(JSONObject));
$.each(obj, function (key, value) {
var s = '';
$.each(value, function (key, value) {
s += (s == '' ? value : (':' + value));
});
console.log(s);
});