diff --git a/TODO b/TODO new file mode 100644 index 0000000..752a6b9 --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +1. 视频分辨率切换问题 +2. 还是没声音 +3. 综合调试 \ No newline at end of file diff --git a/web/src/components/AceScreen.vue b/web/src/components/AceScreen.vue index 815fe7b..446e64a 100644 --- a/web/src/components/AceScreen.vue +++ b/web/src/components/AceScreen.vue @@ -2,7 +2,7 @@
-
@@ -66,6 +66,7 @@ onMounted(() => { props.methods.resetVM = resetVM; const video = document.querySelector("canvas#vnc"); + video.oncontextmenu = () => false; store.getICEServers().then((servers) => { const pc = new RTCPeerConnection({ @@ -99,6 +100,13 @@ onMounted(() => { el.controls = false; el.oncontextmenu = () => false; document.getElementById("data").appendChild(el); + + if (el.track.kind === "video") { + const ctx = video.getContext("2d"); + setTimeout(() => { + ctx.drawImage(this.video, 0, 0); + }, 0); + } }; dataChannel.onopen = () => { @@ -156,6 +164,7 @@ onMounted(() => { \ No newline at end of file