[test] p2p
This commit is contained in:
@@ -85,7 +85,6 @@ type ReciveData = ReciveFirst|RequestFirst
|
|||||||
|
|
||||||
export async function joinMultiuserRoom(){
|
export async function joinMultiuserRoom(){
|
||||||
|
|
||||||
const roomId = await alertInput("Enter room id")
|
|
||||||
//join a room with webrtc
|
//join a room with webrtc
|
||||||
alertWait("Loading...")
|
alertWait("Loading...")
|
||||||
const peerJS = await importPeerJS();
|
const peerJS = await importPeerJS();
|
||||||
@@ -93,6 +92,8 @@ export async function joinMultiuserRoom(){
|
|||||||
v4() + "-risuai-multiuser-join"
|
v4() + "-risuai-multiuser-join"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
peer.on('open', async (id) => {
|
||||||
|
const roomId = await alertInput("Enter room id")
|
||||||
alertWait("Waiting for peerserver to connect...")
|
alertWait("Waiting for peerserver to connect...")
|
||||||
|
|
||||||
let open = false
|
let open = false
|
||||||
@@ -141,10 +142,7 @@ export async function joinMultiuserRoom(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
alertNormal("Connected")
|
alertNormal("Connected")
|
||||||
|
});
|
||||||
return {
|
|
||||||
peer, roomId, conn
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user