Sfoglia il codice sorgente

fix:监听websocket连接成功开始计时

lihao 2 anni fa
parent
commit
8dd91b54a7
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      static/screenIos/WXtrialInterface.html

+ 3 - 1
static/screenIos/WXtrialInterface.html

@@ -1159,8 +1159,10 @@
         encodeURIComponent(cardToken),
       );
       window.webSocketWorker = webSocketWorker;
-      webSocketWorker.onmessage = function (event) {
+      webSocketWorker.onopen = function() {
         getResidueTime();
+      }
+      webSocketWorker.onmessage = function (event) {
         var input = event.data;
         if (input[0] == 0xff && isAudioPlay) {
           decodeAAC(input);