Skip to content

Commit 79135cd

Browse files
committed
Restore component files with formatting fixes after merge
1 parent 18430ee commit 79135cd

File tree

6 files changed

+53
-46
lines changed

6 files changed

+53
-46
lines changed

src/components/Inputs/MediaRecord/MediaRecord.vue

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
<video v-show="!hasRecording" ref="live" id="live_recording" playsinline autoplay muted></video>
1313
<video v-show="hasRecording && isPlaying" ref="recorded" id="recorded-footage" playsinline autoplay></video>
1414
</div>
15+
<div v-if="audio && visualizer" class="container-fluid">
16+
<div class="pids-wrapper">
17+
<div v-for="i in 10" :key="i" class="pid"></div>
18+
</div>
19+
</div>
1520
<div v-if="audio && !audioStreamDevice" class="mt-2">
1621
<label>{{ $t('select-microphone') }}</label>
1722
<select v-model="tempDeviceName" class="form-control">
@@ -55,6 +60,32 @@
5560
import _ from 'lodash';
5661
const MediaStreamRecorder = require('msr');
5762
63+
function handleInit(newInit) {
64+
if (newInit === 'skip' || newInit === 'dontKnow') {
65+
this.hasRecording = false;
66+
} else if (newInit) {
67+
if (_.isString(newInit) && newInit.startsWith('blob')) {
68+
if (this.video) {
69+
this.recording.src = newInit;
70+
} else {
71+
this.recording = new Audio(newInit);
72+
this.recording.onended = this.endPlay;
73+
}
74+
this.hasRecording = true;
75+
} else if (newInit instanceof Blob) {
76+
const blobURL = URL.createObjectURL(newInit);
77+
if (this.video) {
78+
this.recording.src = blobURL;
79+
} else {
80+
this.recording = new Audio(blobURL);
81+
this.recording.onended = this.endPlay;
82+
}
83+
this.recording.blob = newInit;
84+
this.hasRecording = true;
85+
}
86+
}
87+
}
88+
5889
export default {
5990
name: 'MediaRecord',
6091
props: {
@@ -134,6 +165,21 @@ export default {
134165
return '';
135166
},
136167
},
168+
watch: {
169+
init: handleInit,
170+
},
171+
mounted() {
172+
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
173+
this.supported = true;
174+
if (this.audio) {
175+
this.getDevices();
176+
}
177+
this.initializeMedia();
178+
} else {
179+
this.supported = false;
180+
}
181+
handleInit.call(this, this.init);
182+
},
137183
methods: {
138184
getDevices() {
139185
navigator.mediaDevices.enumerateDevices().then((devices) => {
@@ -264,43 +310,5 @@ export default {
264310
};
265311
},
266312
},
267-
watch: {
268-
init(newInit) {
269-
if (newInit === 'skip' || newInit === 'dontKnow') {
270-
this.hasRecording = false;
271-
} else if (newInit) {
272-
if (_.isString(newInit) && newInit.startsWith('blob')) {
273-
if (this.video) {
274-
this.recording.src = newInit;
275-
} else {
276-
this.recording = new Audio(newInit);
277-
this.recording.onended = this.endPlay;
278-
}
279-
this.hasRecording = true;
280-
} else if (newInit instanceof Blob) {
281-
const blobURL = URL.createObjectURL(newInit);
282-
if (this.video) {
283-
this.recording.src = blobURL;
284-
} else {
285-
this.recording = new Audio(blobURL);
286-
this.recording.onended = this.endPlay;
287-
}
288-
this.recording.blob = newInit;
289-
this.hasRecording = true;
290-
}
291-
}
292-
},
293-
},
294-
mounted() {
295-
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
296-
this.supported = true;
297-
if (this.audio) {
298-
this.getDevices();
299-
}
300-
this.initializeMedia();
301-
} else {
302-
this.supported = false;
303-
}
304-
},
305313
};
306314
</script>

src/components/Inputs/ParticipantId/ParticipantId.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default {
3131
methods: {
3232
onSubmit(e) {
3333
e.preventDefault();
34-
// console.log(25, 'submit', this.input);
34+
3535
this.$emit('valueChanged', this.input);
3636
},
3737
},

src/components/Inputs/RangeInput/RangeInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ export default {
9696
}
9797
},
9898
isValid() {
99-
// console.log(this.input, Number.isInteger(this.input));
99+
100100
const num = parseFloat(this.input);
101101
if (isNaN(num)) {
102102
return false;
103103
}
104104
return Number.isFinite(num);
105105
},
106106
isValidRange() {
107-
// console.log(this.input, Number.isInteger(this.input));
107+
108108
const num1 = parseFloat(this.input1);
109109
const num2 = parseFloat(this.input2);
110110
if (num2 > num1) {

src/components/Inputs/SelectInput/SelectInput.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default {
104104
computed: {
105105
multipleAllowed() {
106106
if (this.constraints['http://schema.repronim.org/multipleChoice']) {
107-
// console.log(94, this.constraints[this.reprotermsUrl+'multipleChoice']);
107+
108108
return this.constraints['http://schema.repronim.org/multipleChoice'][0]['@value'];
109109
}
110110
return false;
@@ -121,8 +121,7 @@ export default {
121121
},
122122
},
123123
mounted() {
124-
if (this.init) {
125-
// console.log(74, this.init);
124+
126125
if (Array.isArray(this.init)) {
127126
this.selected = this.init[0];
128127
this.otherInput = this.init[1];

src/components/Inputs/WebFloatInput/FloatInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default {
8686
}
8787
},
8888
isValid() {
89-
// console.log(this.input, Number.isInteger(this.input));
89+
9090
const num = parseFloat(this.input1);
9191
if (isNaN(num)) {
9292
return false;

src/components/Inputs/WebIntegerInput/IntegerInput.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default {
8686
}
8787
},
8888
isValid() {
89-
// console.log(this.input, Number.isInteger(this.input));
89+
9090
const num = parseFloat(this.input1);
9191
if (isNaN(num)) {
9292
return false;

0 commit comments

Comments
 (0)