Browse Source

add audio todo

Michael Wang 6 years ago
parent
commit
d98c64487d
1 changed files with 18 additions and 0 deletions
  1. 18 0
      src/features/OnlineExam/Examing/QuestionBody.vue

+ 18 - 0
src/features/OnlineExam/Examing/QuestionBody.vue

@@ -134,6 +134,24 @@ export default {
         question.audio = [];
       }
       this.questionDetail = question;
+
+      // TODO: web audio get data progress, then construct audio element
+      // for (let { src, name } of this.questionDetail.audio) {
+      // var xmlhttp = new XMLHttpRequest(),
+      //   method = "GET",
+      //   url = src;
+
+      // xmlhttp.open(method, url, true);
+      // xmlhttp.onprogress = function(e) {
+      //   //do something
+      //   console.log(e);
+      // };
+      // xmlhttp.send();
+      //   fetch(src, { method: "HEAD", mode: "cors" }).then(res => {
+      //     console.log(res);
+      //     console.log([...res.headers.keys()]);
+      //   });
+      // }
     },
     // bindAudioPlay() {
     //   const audios = document.getElementsByTagName("audio");