var enableInlineVideo = (function () {
  "use strict";
  function A(A, g, I, C) {
    function e(I) {
      ((i = g(e, C)), A(I - (t || I)), (t = I));
    }
    var i, t;
    return {
      start: function () {
        i || e(0);
      },
      stop: function () {
        (I(i), (i = null), (t = 0));
      },
    };
  }
  function g(g) {
    return A(g, requestAnimationFrame, cancelAnimationFrame);
  }
  function I(A, g, I) {
    function C(C) {
      (!I || I(A, g)) && C.stopImmediatePropagation();
    }
    return (A.addEventListener(g, C), C);
  }
  function C(A, g, I, C) {
    function e() {
      return I[g];
    }
    function i(A) {
      I[g] = A;
    }
    (C && i(A[g]), Object.defineProperty(A, g, { get: e, set: i }));
  }
  function e(A, g, I) {
    I.addEventListener(g, function () {
      return A.dispatchEvent(new Event(g));
    });
  }
  function i(A, g) {
    Promise.resolve().then(function () {
      A.dispatchEvent(new Event(g));
    });
  }
  function t(A) {
    var g = new Audio();
    return (
      e(A, "play", g),
      e(A, "playing", g),
      e(A, "pause", g),
      (g.crossOrigin = A.crossOrigin),
      (g.src = A.src || A.currentSrc || "data:"),
      g
    );
  }
  function n(A, g, I) {
    (Date.now() > (p || 0) + 200 && ((A[h] = !0), (p = Date.now())),
      I || (A.currentTime = g),
      (y[++f % 3] = 0 | (100 * g)));
  }
  function o(A) {
    return A.driver.currentTime >= A.video.duration;
  }
  function r(A) {
    var g = this;
    (g.video.readyState >= g.video.HAVE_FUTURE_DATA
      ? (g.hasAudio ||
          ((g.driver.currentTime =
            g.video.currentTime + (A * g.video.playbackRate) / 1e3),
          g.video.loop && o(g) && (g.driver.currentTime = 0)),
        n(g.video, g.driver.currentTime))
      : g.video.networkState === g.video.NETWORK_IDLE &&
        0 === g.video.buffered.length &&
        g.video.load(),
      c(g) && (delete g.video[h], g.video.pause(!0)));
  }
  function a() {
    var A = this,
      g = A[v];
    if (A.webkitDisplayingFullscreen) return (A[G](), void 0);
    if (
      ("data:" !== g.driver.src &&
        g.driver.src !== A.src &&
        (n(A, 0, !0), (g.driver.src = A.src)),
      A.paused)
    ) {
      ((g.paused = !1), 0 === A.buffered.length && A.load());
      var I = g.driver.play();
      (I &&
        I.catch(function (A) {
          console.warn("videoPlayer audio play():", A);
        }),
        g.updater.start(),
        g.hasAudio ||
          (i(A, "play"),
          g.video.readyState >= g.video.HAVE_ENOUGH_DATA && i(A, "playing")));
    }
  }
  function d(A) {
    var g = this,
      I = g[v];
    (I.driver.pause(),
      I.updater.stop(),
      g.webkitDisplayingFullscreen && g[b](),
      (!I.paused || A) &&
        ((I.paused = !0),
        I.hasAudio || i(g, "pause"),
        c(I) && !g.webkitDisplayingFullscreen && ((g[h] = !0), i(g, "ended"))));
  }
  function c(A) {
    var g = A.video.currentTime >= A.video.duration - 0.15;
    return g;
  }
  function l(A, I) {
    var C = {};
    ((A[v] = C),
      (C.paused = !0),
      (C.hasAudio = I),
      (C.video = A),
      (C.updater = g(r.bind(C))),
      I
        ? (C.driver = t(A))
        : (A.addEventListener("canplay", function () {
            A.paused || i(A, "playing");
          }),
          (C.driver = {
            src: A.src || A.currentSrc || "data:",
            muted: !0,
            paused: !0,
            pause: function () {
              C.driver.paused = !0;
            },
            play: function () {
              ((C.driver.paused = !1), o(C) && n(A, 0));
            },
            get ended() {
              return o(C);
            },
          })),
      A.addEventListener(
        "emptied",
        function () {
          var g = !C.driver.src || "data:" === C.driver.src;
          if (C.driver.src && C.driver.src !== A.src)
            if (
              (n(A, 0, !0), (C.driver.src = A.src), g || (!I && A.autoplay))
            ) {
              var e = C.driver.play();
              e &&
                e.catch(function (A) {
                  console.warn("videoPlayer audio play():", A);
                });
            } else C.updater.stop();
        },
        !1,
      ),
      A.addEventListener("webkitbeginfullscreen", function () {
        A.paused
          ? I && 0 === C.driver.buffered.length && C.driver.load()
          : (A.pause(), A[G]());
      }),
      I &&
        (A.addEventListener("webkitendfullscreen", function () {
          C.driver.currentTime = A.currentTime;
        }),
        A.addEventListener("seeking", function () {
          0 > y.indexOf(0 | (100 * A.currentTime)) &&
            (console.log("User-requested seeking"),
            (C.driver.currentTime = A.currentTime));
        })));
  }
  function u(A) {
    var g = A[h];
    return (delete A[h], !A.webkitDisplayingFullscreen && !g);
  }
  function m(A) {
    var g = A[v];
    ((A[G] = A.play),
      (A[b] = A.pause),
      (A.play = a),
      (A.pause = d),
      C(A, "paused", g.driver),
      C(A, "muted", g.driver, !0),
      C(A, "playbackRate", g.driver, !0),
      C(A, "ended", g.driver),
      C(A, "loop", g.driver, !0),
      I(A, "seeking", function (A) {
        return !A.webkitDisplayingFullscreen;
      }),
      I(A, "seeked", function (A) {
        return !A.webkitDisplayingFullscreen;
      }),
      I(A, "timeupdate", u),
      I(A, "ended", u));
  }
  function s(A, g) {
    if ((void 0 === g && (g = {}), !A[v])) {
      if (!g.everywhere) {
        if (!Z) return;
        if (
          !(g.iPad || g.ipad ? /iPhone|iPod|iPad/ : /iPhone|iPod/).test(
            navigator.userAgent,
          )
        )
          return;
      }
      A.pause();
      var I = A.autoplay;
      ((A.autoplay = !1),
        l(A, !A.muted),
        m(A),
        A.classList.add("IIV"),
        A.muted &&
          I &&
          (A.play(),
          A.addEventListener("playing", function C() {
            ((A.autoplay = !0), A.removeEventListener("playing", C));
          })),
        /iPhone|iPod|iPad/.test(navigator.platform) ||
          console.warn(
            "iphone-inline-video is not guaranteed to work in emulated environments",
          ));
    }
  }
  var p,
    Z =
      "object" == typeof document &&
      "object-fit" in document.head.style &&
      !matchMedia("(-webkit-video-playable-inline)").matches,
    v = "bfred-it:iphone-inline-video",
    h = "bfred-it:iphone-inline-video:event",
    G = "bfred-it:iphone-inline-video:nativeplay",
    b = "bfred-it:iphone-inline-video:nativepause",
    y = [],
    f = 0;
  return s;
})();
!(function (A) {
  function g(A) {
    function g() {
      ((x = A.loop ? A.loop : !1),
        (S = A.muted ? A.muted : !1),
        (T = A.leavePauseBackPlay ? A.leavePauseBackPlay : !1),
        (X = A.poster ? A.poster : void 0),
        (q = A.audioUrl ? A.audioUrl : void 0),
        (Y = A.onStart ? A.onStart : void 0),
        (k = A.onLoadedProgress ? A.onLoadedProgress : void 0),
        (E = A.onLoadedComplete ? A.onLoadedComplete : void 0),
        (W = A.onEnd ? A.onEnd : void 0),
        (J = A.timesParam ? A.timesParam : void 0),
        (N = A.onTimes ? A.onTimes : void 0),
        (V = A.tryMultipleVideoPlayAtTheSameTime
          ? A.tryMultipleVideoPlayAtTheSameTime
          : !1),
        (z = A.onPlaying ? A.onPlaying : void 0),
        (O = A.onWaiting ? A.onWaiting : void 0),
        (L = A.onError ? A.onError : void 0),
        (P = A.onSeeked ? A.onSeeked : void 0),
        (B = A.onSeeking ? A.onSeeking : void 0),
        (ng = void 0 != A.ptt ? A.ptt : !0));
      var g =
        " .IIV::-webkit-media-controls-play-button,   .IIV::-webkit-media-controls-start-playback-button {  opacity: 0;    pointer-events: none;    width: 5px;}";
      (i(g),
        (j = A.src),
        (w = A.videoElement),
        w.setAttribute("preload", "auto"),
        w.setAttribute("x-webkit-airplay", "true"),
        w.setAttribute("airplay", "allow"),
        w.setAttribute("webkit-playsinline", "true"),
        w.setAttribute("playsinline", "true"),
        e(!0),
        T && document.addEventListener("visibilitychange", I),
        (w.muted = S),
        X && (w.poster = X),
        n(),
        f("init", "��Ƶ�����ʼ��"),
        (J && 0 == J.length) || f("setTimesParam", "����ʱ��ڵ�"));
    }
    function I() {
      switch (document.visibilityState) {
        case "hidden":
          og.paused || ((Ag = og.paused), og.pause());
          break;
        case "visible":
          Ag || void 0 == Ag || ((Ag = void 0), og.play());
      }
    }
    function C() {
      (console.log("videoPlayer removeAllEventListener"),
        T && document.removeEventListener("visibilitychange", I),
        e(!1));
    }
    function e(A) {
      for (
        var g = [
            "canplay",
            "canplaythrough",
            "timeupdate",
            "ended",
            "abort",
            "durationchange",
            "emptied",
            "error",
            "loadeddata",
            "loadedmetadata",
            "loadstart",
            "pause",
            "play",
            "playing",
            "ratechange",
            "seeked",
            "seeking",
            "stalled",
            "suspend",
            "volumechange",
            "waiting",
          ],
          I = 0;
        g.length > I;
        I++
      )
        A
          ? (w.removeEventListener(g[I], a), w.addEventListener(g[I], a))
          : w.removeEventListener(g[I], a);
    }
    function i(A) {
      var g = document.getElementsByTagName("head")[0],
        I = document.createElement("style"),
        C = document.createTextNode(A);
      ((I.type = "text/css"),
        I.styleSheet ? (I.styleSheet.cssText = C.nodeValue) : I.appendChild(C),
        g.appendChild(I));
    }
    function t(A, g) {
      if (ng)
        try {
          var I = document.createElement("img"),
            C =
              "https://pingfore.qq.com/pingd?dm=" +
              A +
              ".hot&url=/&arg=-&hottag=" +
              encodeURIComponent(g) +
              "&hotx=9999&hoty=9999&rand=" +
              Math.random() +
              "&tgmobileshare=1";
          (I.setAttribute("src", C),
            I.setAttribute(
              "style",
              "display:none;position:fixed;left:-999999px;top:-999999px;width:0;height:0;",
            ),
            document.body.appendChild(I));
        } catch (e) {
          console.log("videoPlayer sendData error!");
        }
    }
    function n() {
      !ng;
    }
    function o() {
      if ($) {
        if ((($ = !1), (w.src = j), s(), p())) {
          var A = h();
          V
            ? ((gg = !0),
              enableInlineVideo(w, { muted: S, audioUrl: q ? q : og.src }))
            : -1 == A ||
              (8 >= A
                ? ((gg = !0),
                  enableInlineVideo(w, { muted: S, audioUrl: q ? q : og.src }))
                : v() ||
                  Z() ||
                  ((gg = !0),
                  enableInlineVideo(w, {
                    muted: S,
                    audioUrl: q ? q : og.src,
                  })));
        }
        r();
      }
    }
    function r() {
      J && J.length > 0 ? ((tg = !0), u()) : (tg = !1);
    }
    function a(A) {
      if (("timeupdate" != A.type, !R()))
        switch (("timeupdate" != A.type, A.type)) {
          case "seeking":
            B && B({ target: og, id: w.id });
            break;
          case "seeked":
            P && P({ target: og, id: w.id });
            break;
          case "pause":
            break;
          case "canplaythrough":
            break;
          case "error":
            L && L({ target: og, id: w.id });
            break;
          case "waiting":
            O && O({ target: og, id: w.id });
            break;
          case "playing":
            z && z({ target: og, id: w.id });
            break;
          case "canplay":
            Ig && (D(0), w.pause());
            break;
          case "timeupdate":
            w.currentTime > 0 && m(A);
            break;
          case "loadedmetadata":
            break;
          case "ended":
            (f("ended", "�������"),
              W && W({ target: og, id: w.id }),
              og.loop && og.replay());
        }
    }
    function d() {
      if (!R() && J)
        for (var A = 0; J.length > A; A++)
          J[A].trigger ||
            (l(w.currentTime, J[A].time) &&
              ((J[A].trigger = !0), c(A, J), N && N(J[A].name)));
    }
    function c(A, g) {
      if (g && 0 != g.length)
        for (var I = 0; g.length > I; I++)
          I != A && g[I].trigger && (g[I].trigger = !1);
    }
    function l(A, g) {
      A = ((100 * A) >> 0) / 100;
      var I = !1,
        C = 0.03;
      return (g + C > A && A > g - 15 * C && (I = !0), I);
    }
    function u() {
      tg && (requestAnimFrame(u), d());
    }
    function m(A) {
      Cg ||
        ("none" == w.style.display && (w.style.display = "block"),
        G()
          ? "timeupdate" == A.type &&
            Y &&
            _ &&
            ((_ = !1), f("start", "��ʼ����"), Y({ target: og, id: w.id }))
          : Y &&
            _ &&
            ((_ = !1),
            f("start", "��ʼ����"),
            Y({ target: og, id: w.id }),
            s()));
    }
    function s() {
      R() ||
        (clearInterval(F),
        (E || k) &&
          (F = setInterval(function () {
            return ig
              ? (clearInterval(F), void 0)
              : (w.buffered.length > 0 &&
                  (k &&
                    k({
                      target: og,
                      id: w.id,
                      progress: w.buffered.end(w.buffered.length - 1),
                    }),
                  w.buffered.end(w.buffered.length - 1) >=
                    w.duration + (p() || G() ? -0.5 : 0) &&
                    (E && E({ target: og, id: w.id }), clearInterval(F))),
                void 0);
          }, 30)));
    }
    function p() {
      var A = navigator.userAgent,
        g = !!A.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
      return g;
    }
    function Z() {
      var A = navigator.userAgent;
      return "MicroMessenger" == A.match(/MicroMessenger/i) ? !0 : !1;
    }
    function v() {
      var A = navigator.userAgent;
      return "QQ/" == A.match(/QQ\//i) ? !0 : !1;
    }
    function h() {
      var A,
        g = window.navigator.userAgent.toLowerCase(),
        I = g.match(/cpu iphone os (.*?) like mac os/);
      return window.navigator.platform.toLowerCase().indexOf("win32") >= 0
        ? (A = -1)
        : I
          ? (A = I[1].replace(/_/g, "."))
          : void 0;
    }
    function G() {
      var A = navigator.userAgent,
        g = A.indexOf("Android") > -1 || A.indexOf("Adr") > -1;
      return g;
    }
    function b(A) {
      if (Z() && p()) {
        var g = new Date();
        (console.log("videoPlayer wxbr start"),
          "object" == typeof WeixinJSBridge
            ? WeixinJSBridge.invoke("WeixinJSBridgeReady", {}, function () {
                (console.log(
                  "invoke videoPlayer wxbr callBack time:",
                  new Date().getTime() - g.getTime(),
                ),
                  A());
              })
            : document.addEventListener(
                "WeixinJSBridgeReady",
                function () {
                  (console.log(
                    "addEventListener videoPlayer wxbr callBack time:",
                    new Date().getTime() - g.getTime(),
                  ),
                    A());
                },
                !1,
              ));
      } else A();
    }
    function y() {
      var A = !1,
        g = h();
      return (
        p() && (A = -1 == g ? !1 : 8 >= g ? !1 : Z() || v() ? !0 : !1),
        A
      );
    }
    function f(A) {
      if (ng && "function" == typeof PTTSendClick) {
        for (
          var g = window.location.hostname.split("."),
            I = window.location.pathname.split("/"),
            C = g.concat(I),
            e = "",
            i = 0;
          C.length > i;
          i++
        )
          1 == C[i].split(".").length && "" != C[i] && (e += C[i] + "_");
        ((e = e.substr(0, e.length - 1)),
          (e = "mmd_videoPlayer." + e + "." + (A + "")),
          t("tgideas.qq.com", e));
      }
    }
    function M() {
      (b(function () {
        gg ? (Q(0), w.play()) : G() ? (Q(1), w.play()) : (Q(2), w.load());
      }),
        f("load", "��ʼ����"));
    }
    function R() {
      var A = !1;
      return ((eg || ig) && (A = !0), A);
    }
    function D() {}
    function Q() {}
    var w,
      j,
      Y,
      W,
      k,
      E,
      N,
      T,
      z,
      O,
      L,
      B,
      P,
      J,
      V,
      F,
      S,
      U,
      x,
      H,
      K,
      X,
      q,
      _ = !0,
      $ = !0,
      Ag = void 0,
      gg = !1,
      Ig = !0,
      Cg = !1,
      eg = !1,
      ig = !1,
      tg = !1,
      ng = !0,
      og = this,
      rg =
        "data:video/mp4;base64, ";
    (g(),
      Object.defineProperty(this, "isUseIphoneinlinevideo", {
        get: function () {
          return gg;
        },
      }),
      Object.defineProperty(this, "muted", {
        get: function () {
          return S;
        },
        set: function (A) {
          ((S = A), (w.muted = S));
        },
      }),
      Object.defineProperty(this, "playbackRate", {
        get: function () {
          return U;
        },
        set: function (A) {
          ((U = A), (w.playbackRate = U));
        },
      }),
      Object.defineProperty(this, "bufferedTime", {
        get: function () {
          return w.buffered.end(0);
        },
      }),
      Object.defineProperty(this, "currentTime", {
        get: function () {
          return w.currentTime;
        },
      }),
      Object.defineProperty(this, "currentTimeAndPlay", {
        set: function (A) {
          ((H = A),
            gg
              ? (D(1),
                w.pause(),
                (w.currentTime = H),
                setTimeout(function () {}, 10),
                setTimeout(function () {}, 30),
                setTimeout(function () {}, 60),
                setTimeout(function () {
                  ((w.currentTime = H), Q(5), og.play());
                }, 100))
              : (og.play(), (w.currentTime = H)),
            c(-1, J));
        },
      }),
      Object.defineProperty(this, "currentTimeAndPause", {
        set: function (A) {
          ((K = A), D(2), w.pause(), (w.currentTime = K), c(-1, J));
        },
      }),
      Object.defineProperty(this, "loop", {
        get: function () {
          return x;
        },
        set: function (A) {
          x = A;
        },
      }),
      Object.defineProperty(this, "paused", {
        get: function () {
          return w.paused;
        },
      }),
      Object.defineProperty(this, "duration", {
        get: function () {
          return w.duration;
        },
      }),
      Object.defineProperty(this, "src", {
        get: function () {
          return j;
        },
        set: function (A) {
          (D(3), og.pause(), (j = A), (_ = !0), ($ = !0), (Ig = !0));
        },
      }),
      Object.defineProperty(this, "visible", {
        get: function () {
          return "block" == w.style.display ? !0 : !1;
        },
        set: function (A) {
          w.style.display = A ? "block" : "none";
        },
      }),
      Object.defineProperty(this, "videoElement", {
        get: function () {
          return w;
        },
      }),
      Object.defineProperty(this, "timesParam", {
        get: function () {
          return J;
        },
        set: function (A) {
          ((J = A), tg ? (J && 0 != J.length) || (tg = !1) : r());
        },
      }),
      Object.defineProperty(this, "poster", {
        get: function () {
          return w.poster;
        },
        set: function (A) {
          w.poster = A;
        },
      }),
      Object.defineProperty(this, "isVideoCanAutoPlay", {
        get: function () {
          return y();
        },
      }),
      (this.play = function () {
        ((Cg = !1),
          (eg = !1),
          (ig = !1),
          (Ig = !1),
          o(),
          b(function () {
            gg ? (Q(3), w.play()) : (Q(4), w.play());
          }),
          f("play", "����"));
      }),
      (this.pause = function () {
        ((Ig = !0), D(4), w.pause(), f("pause", "��ͣ"));
      }),
      (this.replay = function () {
        ((Cg = !1),
          (Ig = !1),
          (eg = !1),
          (ig = !1),
          c(-1, J),
          0 > w.playbackRate && (w.playbackRate = 1),
          (this.currentTimeAndPlay = 0),
          f("replay", "�ز�"));
      }),
      (this.load = function () {
        ((og.visible = !1),
          (eg = !1),
          (ig = !1),
          (Cg = !0),
          o(),
          M(),
          f("load", "��ʼ����"));
      }),
      (this.stopLoad = function () {
        ((og.visible = !1), (ig = !0), (w.src = ""), ($ = !0));
      }),
      (this.activationLoad = function () {
        ((og.visible = !1), (eg = !0));
        var A = og.src;
        ((og.src = rg), o(), ($ = !0), (og.src = A), M());
      }),
      (this.removeAllEventListeners = function () {
        C();
      }));
  }
  ((window.requestAnimFrame = (function () {
    return (
      window.requestAnimationFrame ||
      window.webkitRequestAnimationFrame ||
      window.mozRequestAnimationFrame ||
      function (A) {
        window.setTimeout(A, 1e3 / 60);
      }
    );
  })()),
    (A.VideoPlayer = g));
})((this.MMD = this.MMD || {}));
