PsHooN7979
08-14
240814 박세훈 문제 3_4 오디오 파일 적용
@0141fc5289f958416c6bd837e7253ab33747dc8a
+++ client/resources/audio/tt.wav
Binary file is not shown |
--- client/views/pages/main/Chapter/Chapter3_4.vue
+++ client/views/pages/main/Chapter/Chapter3_4.vue
... | ... | @@ -22,8 +22,14 @@ |
22 | 22 |
<button> |
23 | 23 |
<img |
24 | 24 |
src="../../../../resources/img/btn10_s.png" |
25 |
- alt="" |
|
25 |
+ alt="Listen" |
|
26 |
+ @click="playAudio" |
|
26 | 27 |
/> |
28 |
+ <audio |
|
29 |
+ id="audio-player" |
|
30 |
+ src="client/resources/audio/tt.wav" |
|
31 |
+ preload="auto" |
|
32 |
+ ></audio> |
|
27 | 33 |
</button> |
28 | 34 |
</div> |
29 | 35 |
|
... | ... | @@ -197,6 +203,11 @@ |
197 | 203 |
console.log("answer submit - error : ", error); |
198 | 204 |
}); |
199 | 205 |
}, |
206 |
+ playAudio() { |
|
207 |
+ const audio = document.getElementById("audio-player"); |
|
208 |
+ audio.play(); |
|
209 |
+ console.log("playing"); |
|
210 |
+ }, |
|
200 | 211 |
}, |
201 | 212 |
watch: {}, |
202 | 213 |
computed: {}, |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?