Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
  • Loading branch information
DorraJaouad committed Oct 8, 2024
1 parent b0d93cf commit ec3c57d
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions src/components/MediaSettings/MediaSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ import { useGuestNameStore } from '../../stores/guestName.js'
import { useSettingsStore } from '../../stores/settings.js'
import { localMediaModel } from '../../utils/webrtc/index.js'

const MEDIA_PREFERENCE = getTalkConfig('local', 'call', 'start-without-media')

export default {
name: 'MediaSettings',

Expand Down Expand Up @@ -543,11 +545,24 @@ export default {
if (this.updatedBackground) {
this.handleUpdateBackground(this.updatedBackground)
}
if (this.audioDeviceStateChanged) {
emit('local-audio-control-button:toggle-audio')
}
if (this.videoDeviceStateChanged) {
emit('local-video-control-button:toggle-video')

if (!MEDIA_PREFERENCE) {
if (this.audioDeviceStateChanged) {
emit('local-audio-control-button:toggle-audio')
}
if (this.audioDeviceStateChanged) {
emit('local-video-control-button:toggle-video')
}
} else {
if (this.audioOn && !this.audioDeviceStateChanged) {
this.toggleAudio()
emit('local-audio-control-button:toggle-audio')
}
if (this.videoOn && !this.videoDeviceStateChanged) {
this.toggleVideo()
emit('local-video-control-button:toggle-video')
}

}

this.closeModal()
Expand Down

0 comments on commit ec3c57d

Please sign in to comment.