change mirror
This commit is contained in:
parent
bc2b7dfb1e
commit
285c149943
|
|
@ -41,14 +41,14 @@ export default defineComponent({
|
|||
cameraId: data.videoDeviceId,
|
||||
microphoneId: data.audioDeviceId
|
||||
})
|
||||
emit('switch', { type: 'video', cameraId: data.videoDeviceId })
|
||||
emit('switch', { type: 'video', cameraId: data.videoDeviceId, isMirror: false })
|
||||
} else {
|
||||
data.videoDeviceId = data.videoList[0].deviceId
|
||||
emit('init', {
|
||||
cameraId: data.videoDeviceId,
|
||||
microphoneId: data.audioDeviceId
|
||||
})
|
||||
emit('switch', { type: 'video', cameraId: data.videoDeviceId })
|
||||
emit('switch', { type: 'video', cameraId: data.videoDeviceId, isMirror: true })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,8 @@ export default {
|
|||
userSig: null,
|
||||
roomId: null,
|
||||
taskId: null,
|
||||
remoteStreamList: []
|
||||
remoteStreamList: [],
|
||||
isMirror: true
|
||||
})
|
||||
|
||||
const settings = reactive({
|
||||
|
|
@ -295,8 +296,7 @@ export default {
|
|||
video: true,
|
||||
userId: data.userId,
|
||||
cameraId: settings.cameraId,
|
||||
microphoneId: settings.microphoneId,
|
||||
mirror: false
|
||||
microphoneId: settings.microphoneId
|
||||
})
|
||||
try {
|
||||
await settings.localStream.initialize()
|
||||
|
|
@ -313,7 +313,7 @@ export default {
|
|||
if (settings.localStream && settings.isPlayingLocalStream) {
|
||||
settings.isPlayingLocalStream = false
|
||||
}
|
||||
settings.localStream.play('localStream')
|
||||
settings.localStream.play('localStream', { mirror: data.isMirror })
|
||||
.then(() => {
|
||||
settings.isPlayingLocalStream = true
|
||||
})
|
||||
|
|
@ -431,10 +431,12 @@ export default {
|
|||
* @param {*} cameraId
|
||||
* @return {*}
|
||||
*/
|
||||
const handleCamareSwitch = ({ type, cameraId }) => {
|
||||
const handleCamareSwitch = ({ type, cameraId, isMirror = true }) => {
|
||||
try {
|
||||
if (settings.localStream) {
|
||||
data.isMirror = isMirror
|
||||
settings.localStream.switchDevice(type, cameraId)
|
||||
playLocalStream()
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('switchDevice failed', error)
|
||||
|
|
@ -498,7 +500,6 @@ export default {
|
|||
}
|
||||
await axios.put(`/api/meeting/heartbeatTime`, params)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 翻转摄像头
|
||||
* @return {*}
|
||||
|
|
|
|||
Loading…
Reference in New Issue