Bläddra i källkod

feat(推流广告): 同步广告播放方案

曾志翔 3 år sedan
förälder
incheckning
c9745b39a7
2 ändrade filer med 1340 tillägg och 1057 borttagningar
  1. 1334 1049
      screenAndroid/WXtrialInterface.html
  2. 6 8
      screenIos/WXtrialInterface.html

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1334 - 1049
screenAndroid/WXtrialInterface.html


+ 6 - 8
screenIos/WXtrialInterface.html

@@ -205,7 +205,6 @@
           width="100%"
           height="100%"
           id="source"
-          muted
           autoplay="autoplay"
           loop="loop"
           webkit-playsinline="true"
@@ -389,7 +388,6 @@
       var winese = document.createElement('wine');
       wine.style.top = '-' + winese + 'px';
       var isAudioPlay = false;
-      // adInit();
       initAD();
       $.alert({
         title: '提示',
@@ -976,9 +974,9 @@
         });
       }
       //广告信息
-      let adData = null; // 广告数据
-      let adLastTime = 0; // 广告时间
-      let intervalTime = 0; // 间隔时间
+      var adData = null; // 广告数据
+      var adLastTime = 0; // 广告时间
+      var intervalTime = 0; // 间隔时间
       // let adType = 0;
       console.log(
         '🚀 ~ file: WXtrialInterface.html ~ line 973 ~ sourceType',
@@ -1000,7 +998,7 @@
           contentType: 'application/json;charset=UTF-8',
         }).then(function (res) {
           if (res.status === 0) {
-            const list = res.data.filter(
+            var list = res.data.filter(
               (v) => v.adType === 1 && !!v.adVideoBase.videoUrl,
             );
             adData = list[Math.floor(Math.random() * list.length)];
@@ -1016,7 +1014,7 @@
       }
       // 播放广告
       function playAD() {
-        const nowTime = Date.now();
+        var nowTime = Date.now();
         if (
           adData &&
           // [1, 2].includes(sourceType) &&
@@ -1083,7 +1081,7 @@
             case 2: {
               return getConfigByPhoneType().then(function (res) {
                 if (res.isDisconnectionTime === 1) {
-                  let time = res.disconnectionTime * 60 * 1000;
+                  var time = res.disconnectionTime * 60 * 1000;
                   setTimeout(() => {
                     disconnectionFlag = true;
                     $('.buy-phone-wrap').eq(0).show();