mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-28 21:01:55 +00:00
wip get passphrase from the backend
This commit is contained in:
@@ -143,6 +143,8 @@ class RoomSerializer(serializers.ModelSerializer):
|
||||
|
||||
output["is_administrable"] = is_admin
|
||||
|
||||
output['passphrase'] = "thisisapassphrase"
|
||||
|
||||
return output
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ export type ApiRoom = {
|
||||
slug: string
|
||||
is_public: boolean
|
||||
is_administrable: boolean
|
||||
passphrase: string
|
||||
livekit?: {
|
||||
url: string
|
||||
room: string
|
||||
|
||||
@@ -68,14 +68,11 @@ export const Conference = ({
|
||||
retry: false,
|
||||
})
|
||||
|
||||
const e2eePassphrase = typeof window !== 'undefined' && 'thisisapassphrase'
|
||||
|
||||
const worker =
|
||||
typeof window !== 'undefined' &&
|
||||
e2eePassphrase &&
|
||||
new Worker(new URL('livekit-client/e2ee-worker', import.meta.url))
|
||||
|
||||
const e2eeEnabled = !!(e2eePassphrase && worker)
|
||||
const e2eeEnabled = !!worker
|
||||
const keyProvider = new ExternalE2EEKeyProvider()
|
||||
|
||||
const [e2eeSetupComplete, setE2eeSetupComplete] = useState(false)
|
||||
@@ -108,9 +105,12 @@ export const Conference = ({
|
||||
const room = useMemo(() => new Room(roomOptions), [roomOptions])
|
||||
|
||||
useEffect(() => {
|
||||
if (!data) {
|
||||
return
|
||||
}
|
||||
if (e2eeEnabled) {
|
||||
keyProvider
|
||||
.setKey('thisisapassphrase')
|
||||
.setKey(data.passphrase)
|
||||
.then(() => {
|
||||
room.setE2EEEnabled(true).catch((e) => {
|
||||
if (e instanceof DeviceUnsupportedError) {
|
||||
@@ -127,7 +127,7 @@ export const Conference = ({
|
||||
} else {
|
||||
setE2eeSetupComplete(true)
|
||||
}
|
||||
}, [e2eeEnabled, room, e2eePassphrase])
|
||||
}, [e2eeEnabled, room, data])
|
||||
|
||||
const [showInviteDialog, setShowInviteDialog] = useState(mode === 'create')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user