[test] p2p

This commit is contained in:
kwaroran
2023-11-22 19:43:10 +09:00
parent 6765fdc50c
commit 7c74d6849e

View File

@@ -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
}
} }