|
@@ -77,16 +77,13 @@ export default {
|
|
|
watch: {
|
|
|
dialogVisibleDevice(newValue) {
|
|
|
if (newValue) {
|
|
|
- const device = this.$store.state.app.liveDevice;
|
|
|
- this.video = this.device.video.length === 0 ? '' : this.selectValue(this.device.video, device.video);
|
|
|
- this.audio = this.device.audio.length === 0 ? '' : this.selectValue(this.device.audio, device.audio);
|
|
|
+ const { video, audio } = this.$store.state.app.liveDevice;
|
|
|
+ this.video = video;
|
|
|
+ this.audio = audio;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- selectValue(arr, value) {
|
|
|
- return arr.some(item => item.deviceId === value) ? value : arr[0].deviceId;
|
|
|
- },
|
|
|
dialogDeviceClose() {
|
|
|
this.$emit('dialogDeviceClose', { audio: this.audio, video: this.video });
|
|
|
}
|