Skip to content

Commit

Permalink
fix: using video tag instead of audio for compatibility purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
jvJUCA committed Jun 25, 2024
1 parent 04b188e commit 16adb91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/components/molecules/FeedbackView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default {
},
methods: {
setupStreams() {
console.log('setupStreams')
this.$refs.localMedia.srcObject = this.localCameraStream
this.$refs.remoteMedia.srcObject = this.remoteCameraStream
},
Expand Down
16 changes: 3 additions & 13 deletions src/views/public/ModeratedTestView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@
</v-card-actions>
</v-card>
</v-dialog>
<audio ref="remoteAudio"></audio>
<video ref="remoteAudio" autoplay playsinline style="display:none;"></video>
</div>
</template>

Expand Down Expand Up @@ -1172,17 +1172,7 @@ export default {
})
},
async setRemoteAudio() {
if (
this.remoteCameraScreen &&
this.remoteCameraScreen.getAudioTracks().length > 0
) {
let audioTrack = this.remoteCameraScreen
.getTracks()
.find((track) => track.kind == 'audio')
const audioStream = new MediaStream([audioTrack])
this.$refs.remoteAudio.srcObject = audioStream
this.$refs.remoteAudio.play()
}
this.$refs.remoteAudio.srcObject = this.remoteCameraStream
},
async uploadVideo(recordedChunks, storagePath) {
const videoBlob = new Blob(recordedChunks, { type: 'video/webm' })
Expand Down Expand Up @@ -1258,6 +1248,7 @@ export default {
async startRecordingModerator() {
this.recording = true
this.recordedChunksModerator = []
const storagePath = `tests/${this.roomTestId}/${this.token}/moderator/video/${this.recordedVideoModerator}`
let moderatorCamera = await navigator.mediaDevices.getUserMedia({
video: true,
audio: true,
Expand All @@ -1272,7 +1263,6 @@ export default {
this.mediaRecorderModerator.onstop = async () => {
this.isLoading = true
const storagePath = `tests/${this.roomTestId}/${this.token}/moderator/video/${this.recordedVideoModerator}`
try {
this.recordedVideoModerator = await this.uploadVideo(
this.recordedChunksModerator,
Expand Down

0 comments on commit 16adb91

Please sign in to comment.