瀏覽代碼

fix(推流广告): 初始化sourceType

曾志翔 3 年之前
父節點
當前提交
aa3c923fc8
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      screenIos/WXtrialInterface.html

+ 4 - 4
screenIos/WXtrialInterface.html

@@ -342,9 +342,12 @@
       var videoTimer = null,
         videoTime = 0,
         adType = 0,
-        sourceType = 0,
+        sourceType = isNaN(parameters['sourceType'])
+          ? sourceType
+          : +parameters['sourceType'],
         disconnectionFlag = false,
         getDate = false;
+
       var topwinHeight = window.screen.height - window.innerHeight + 30; //计算title top 头部
       var url = window.location.href;
       url = url.split('/');
@@ -1053,9 +1056,6 @@
        * 解决方案,初始化时预先请求广告数据,在用户对云手机touchmove事件中去播放广告并请求下一次广告数据。
        */
       function initAD() {
-        sourceType = isNaN(parameters['sourceType'])
-          ? 0
-          : +parameters['sourceType'];
         console.log(
           '🚀 ~ file: WXtrialInterface.html ~ line 1052 ~ initAD ~ sourceType',
           sourceType,