Hey,
I am trying to integrate Jitsi with my iOS app that uses SwiftUI.
I got it far enough to join the meeting, but I couldn’t get it to work with events such as when the user leaves a meeting or somebody joins, etc. How can I do that?
Here is my code:
import Foundation
import UIKit
import SwiftUI
import JitsiMeet
struct JitsiEmbed: UIViewRepresentable {
@Binding var meetServer: String
@Binding var meetCode: String
public func makeUIView(context: Context) -> JitsiMeetView {
let defaultOptions = JitsiMeetConferenceOptions.fromBuilder { (builder) in
builder.serverURL = URL(string: meetServer)
builder.welcomePageEnabled = false
}
JitsiMeet.sharedInstance().defaultConferenceOptions = defaultOptions
// create and configure jitsimeet view
let jitsiMeetView = JitsiMeetView()
let options = JitsiMeetConferenceOptions.fromBuilder { (builder) in
// for JaaS use <tenant>/<roomName> format
builder.room = meetCode
}
// join room and display jitsi-call
jitsiMeetView.join(options)
return jitsiMeetView
}
public func updateUIView(_ uiView: JitsiMeetView , context: Context) {
func conferenceTerminated(_ data: [AnyHashable : Any]!) {
DispatchQueue.main.async {
print("Call Close")
}
}
}
}