This commit is contained in:
Klemek
2025-03-14 08:58:52 +01:00
parent 89f6b03e26
commit a1c477d834
2 changed files with 5 additions and 13 deletions
+1 -1
View File
@@ -51,7 +51,7 @@
<br>
<input type="file" @change="fileChange" />
<br>
<input type="submit" @click.prevent="start" :disabled="!data || !remoteId || !connectionOpen" />
<input type="submit" @click.prevent="start" :disabled="!data || !remoteId || !connection" />
</div>
<br />
<small class="footer">
+4 -12
View File
@@ -44,21 +44,14 @@ const app = createApp({
},
connect() {
if (this.remoteId) {
this.initConnection(this.peer.connect(this.remoteId));
this.initConnection(
this.peer.connect(this.remoteId, { reliable: true }),
);
}
},
initPeer() {
this.peer = new Peer({
config: {
iceServers: [
{ urls: "stun:stun.l.google.com:19302" },
// {
// urls: [`turn:127.0.0.1:3478`, `turns:127.0.0.1:5349`],
// username: "user",
// credential: "pass",
// },
],
},
debug: 3,
});
this.peer.on("open", this.peerOpen);
this.peer.on("connection", this.peerConnection);
@@ -126,7 +119,6 @@ const app = createApp({
connClose() {
console.log("connClose");
this.connection = null;
this.connectionOpen = false;
// TODO handle conn close
},
connError(err) {