Skip to content

Commit

Permalink
fix: remote screen
Browse files Browse the repository at this point in the history
  • Loading branch information
jvJUCA committed Jun 14, 2024
1 parent b3de53a commit ba92e8f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 49 deletions.
27 changes: 7 additions & 20 deletions src/components/molecules/FeedbackView.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<template>
<v-row>
<v-col class="mt-8" cols="12">
<video ref="remoteCamera" class="video" autoplay playsinline />
<video ref="localCamera" class="video" muted autoplay playsinline />
<video ref="remoteScreen" class="video" muted autoplay playsinline />
<video ref="localScreen" class="video" muted autoplay playsinline />
<video ref="remoteMedia" class="video" autoplay playsinline />
<video ref="localMedia" class="video" muted autoplay playsinline />
</v-col>
<v-col cols="12">
<v-row justify="center">
Expand All @@ -23,6 +21,9 @@
mdi-microphone-off
</v-icon>
</v-btn>
<v-btn @click="toggleCameraScreen()" color="blue" block depressed
>TOGGLE CAMERA/SCREEN</v-btn
>
</v-row>
</v-col>
<VideoCall ref="VideoCall" />
Expand Down Expand Up @@ -58,12 +59,6 @@ export default {
remoteCameraStream() {
return this.$store.getters.remoteCameraStream
},
localScreenStream() {
return this.$store.getters.localScreenStream
},
remoteScreenStream() {
return this.$store.getters.remoteScreenStream
},
roomTestId() {
return this.$store.getters.test.id
},
Expand All @@ -78,19 +73,11 @@ export default {
remoteCameraStream(newVal) {
this.setupStreams()
},
localScreenStream(newVal) {
this.setupStreams()
},
remoteScreenStream(newVal) {
this.setupStreams()
},
},
methods: {
setupStreams() {
this.$refs.localCamera.srcObject = this.localCameraStream
this.$refs.remoteCamera.srcObject = this.remoteCameraStream
this.$refs.localScreen.srcObject = this.localScreenStream
this.$refs.remoteScreen.srcObject = this.remoteScreenStream
this.$refs.localMedia.srcObject = this.localCameraStream
this.$refs.remoteMedia.srcObject = this.remoteCameraStream
},
toggleMicrophone() {
if (
Expand Down
10 changes: 1 addition & 9 deletions src/components/molecules/VideoCall.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
depressed
>CONNECT</v-btn
>
<v-btn
v-if="index === 1"
@click="toggleCameraScreen"
color="blue"
block
depressed
>TOGGLE CAMERA/SCREEN</v-btn
>
</v-col>
</v-row>
</v-container>
Expand Down Expand Up @@ -98,7 +90,7 @@ export default {
return this.$store.getters.currentUserTestAnswer
},
},
created() {
mounted() {
if (!this.isAdmin) {
setInterval(this.toggleCameraScreen, 50000) // Remove parentheses from toggleCameraScreen
}
Expand Down
20 changes: 0 additions & 20 deletions src/store/modules/Test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export default {
finalMessage: '',
remoteCameraStream: null,
localCameraStream: null,
remoteScreenStream: null,
localScreenStream: null,
},
getters: {
tests(state) {
Expand Down Expand Up @@ -76,12 +74,6 @@ export default {
localCameraStream(state) {
return state.localCameraStream
},
remoteScreenStream(state) {
return state.remoteScreenStream
},
localScreenStream(state) {
return state.localScreenStream
},
},
mutations: {
SET_TEST(state, payload) {
Expand Down Expand Up @@ -130,12 +122,6 @@ export default {
SET_LOCAL_STREAM(state, stream) {
state.localCameraStream = stream
},
SET_LOCAL_SCREEN_STREAM(state, stream) {
state.localScreenStream = stream
},
SET_REMOTE_SCREEN_STREAM(state, stream) {
state.remoteScreenStream = stream
},
updateCurrentImageUrl(state, url) {
state.currentImageUrl = url // Update currentImageUrl with the new URL
},
Expand Down Expand Up @@ -431,12 +417,6 @@ export default {
setlocalCameraStream({ commit }, stream) {
commit('SET_LOCAL_STREAM', stream)
},
setRemoteScreenStream({ commit }, stream) {
commit('SET_REMOTE_SCREEN_STREAM', stream)
},
setLocalScreenStream({ commit }, stream) {
commit('SET_LOCAL_SCREEN_STREAM', stream)
},
cleanTest({ commit }) {
try {
commit('CLEAN_TEST')
Expand Down

0 comments on commit ba92e8f

Please sign in to comment.