wip
This commit is contained in:
+1
-1
@@ -51,7 +51,7 @@
|
|||||||
<br>
|
<br>
|
||||||
<input type="file" @change="fileChange" />
|
<input type="file" @change="fileChange" />
|
||||||
<br>
|
<br>
|
||||||
<input type="submit" @click.prevent="start" :disabled="!data || !remoteId || !connectionOpen" />
|
<input type="submit" @click.prevent="start" :disabled="!data || !remoteId || !connection" />
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<small class="footer">
|
<small class="footer">
|
||||||
|
|||||||
@@ -44,21 +44,14 @@ const app = createApp({
|
|||||||
},
|
},
|
||||||
connect() {
|
connect() {
|
||||||
if (this.remoteId) {
|
if (this.remoteId) {
|
||||||
this.initConnection(this.peer.connect(this.remoteId));
|
this.initConnection(
|
||||||
|
this.peer.connect(this.remoteId, { reliable: true }),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
initPeer() {
|
initPeer() {
|
||||||
this.peer = new Peer({
|
this.peer = new Peer({
|
||||||
config: {
|
debug: 3,
|
||||||
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",
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
this.peer.on("open", this.peerOpen);
|
this.peer.on("open", this.peerOpen);
|
||||||
this.peer.on("connection", this.peerConnection);
|
this.peer.on("connection", this.peerConnection);
|
||||||
@@ -126,7 +119,6 @@ const app = createApp({
|
|||||||
connClose() {
|
connClose() {
|
||||||
console.log("connClose");
|
console.log("connClose");
|
||||||
this.connection = null;
|
this.connection = null;
|
||||||
this.connectionOpen = false;
|
|
||||||
// TODO handle conn close
|
// TODO handle conn close
|
||||||
},
|
},
|
||||||
connError(err) {
|
connError(err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user