Skip to content

Commit 04447d2

Browse files
committed
fix call ctl buttons
1 parent 43a77fe commit 04447d2

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

client/src/containers/AudioCall.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,14 @@ onBeforeUnmount(() => {
137137
<button
138138
class="h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 bg-green-500 text-color-white"
139139
@click="callStore.acceptCall()"
140+
@touchend="callStore.acceptCall()"
140141
>
141142
<IconCall :size="40" />
142143
</button>
143144
<button
144145
class="h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 bg-red-500 text-color-white"
145146
@click="callStore.hangup(callStore.currentCallState.callId!)"
147+
@touchend="callStore.hangup(callStore.currentCallState.callId!)"
146148
>
147149
<IconCall :size="40" :rotate="135" />
148150
</button>
@@ -163,6 +165,7 @@ onBeforeUnmount(() => {
163165
<button
164166
class="h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 bg-red-500 text-color-white"
165167
@click="callStore.hangup(callStore.currentCallState?.callId!)"
168+
@touchend="callStore.hangup(callStore.currentCallState?.callId!)"
166169
>
167170
<IconCall :size="40" :rotate="135" />
168171
</button>

client/src/containers/VideoCall.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const callTimer = ref<number | null>(null);
3131
3232
const hideTimeout = ref<number | null>(4);
3333
const countdownInterval = ref<number | null>(null);
34-
let isTouch = "ontouchstart" in window;
34+
let isTouch = "ontouchend" in window;
3535
3636
// Cleanup functions
3737
let watchers: (() => void)[] = [];
@@ -121,12 +121,12 @@ function setupEventListeners() {
121121
e.preventDefault();
122122
showControls();
123123
};
124-
element.addEventListener("touchstart", touchHandler);
124+
element.addEventListener("touchend", touchHandler);
125125
element.addEventListener("touchmove", touchHandler);
126126
127127
// Cleanup function to remove touch listeners
128128
return () => {
129-
element.removeEventListener("touchstart", touchHandler);
129+
element.removeEventListener("touchend", touchHandler);
130130
element.removeEventListener("touchmove", touchHandler);
131131
};
132132
} else {
@@ -285,14 +285,15 @@ onBeforeUnmount(() => {
285285
type="button"
286286
class="h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 bg-green-500 text-color-white"
287287
@click="callStore.acceptCall()"
288-
v-on:focus="console.log('clicked')"
288+
@touchend="callStore.acceptCall()"
289289
>
290290
<IconCall :size="40" />
291291
</button>
292292
<button
293293
type="button"
294294
class="h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 bg-red-500 text-color-white"
295295
@click="callStore.hangup(callStore.currentCallState.callId!)"
296+
@touchend="callStore.hangup(callStore.currentCallState.callId!)"
296297
>
297298
<IconCall :size="40" :rotate="135" />
298299
</button>
@@ -304,20 +305,23 @@ onBeforeUnmount(() => {
304305
<button
305306
class="h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 hover:bg-color-background-mute"
306307
@click="video = callStore.alterVideoStream()"
308+
@touchend="video = callStore.alterVideoStream()"
307309
>
308310
<IconVideoCall :size="40" v-if="video" />
309311
<IconVideoOff :size="40" v-else />
310312
</button>
311313
<button
312314
class="h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 hover:bg-color-background-mute"
313315
@click="unMute = callStore.alterAudioStream()"
316+
@touchend="unMute = callStore.alterAudioStream()"
314317
>
315318
<IconMic v-if="unMute" :size="40" />
316319
<IconMicOff v-else :size="40" />
317320
</button>
318321
<button
319322
class="h-3/4 w-auto aspect-square rounded-full flex items-center justify-center cursor-pointer duration-200 bg-red-500 text-color-white"
320323
@click="callStore.hangup(callStore.currentCallState?.callId!)"
324+
@touchend="callStore.hangup(callStore.currentCallState?.callId!)"
321325
>
322326
<IconCall :size="40" :rotate="135" />
323327
</button>

0 commit comments

Comments
 (0)