/*
* XmlDigitalTeaching v0.0.1
* Copyright ©Thu Jul 24 2025 15:16:57 GMT+0800 (中国标准时间) smile
* Released under the ISC License.
*/
var playIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABxBJREFUeF7dW2tsFFUU/s5sCygo7W4JwfggkZAYNNYnqBB31iI2jYnERwyiRuILFcJuwZQEAgYfDbSzii8CYqDlYRQhUQNIS3cFkRbERxXTYMCCgGI7U0ssXbbbOWa2bu1ruzOzM8suN9lfe+53vvPdc2fu4wwhBc1ddjYPjnA+VM4XBMdogHPAyGFoP2onQgsxt6is/g1QI1RuRFZWY9Cb22g3PbLLgcevFLKqFjKRm4AbTPth3gjQtmHZqNox13XWNE6cjpYK4C5TJhOpj4BQCNA4i8kqALZAVVcH5o86ZBW2JQKIkjID4BkAiqwilgBntVVCJCWA6FeKAC4BY3KKAu/lhsGlWWGhtLrE2WrWvykBCt5Uru5ktQRMs806tqofAT8xqDTgc24yg2lYgHvKW0SV1FUAxptxaFsfxocRYdiivd7hfxjxYUgAj7/5cWaqMOIgxbYNTFgc9Lq26PWrWwBRkr9I4UNOL/8B7ZhoUdDrfE0PiC4BREmuAlCgBzBdbJjopaDX+W4iPgkFEP3yWjBmJQJKy/+ZnwwU5w06ZQcVwF3etJRIWJKWwekkRcC0Gp9rVzzzuAJ4pObpDNqq0086m9ULwtB7d88bcWYgkgMK4Fl+5lrOzv4SzNemc2T6uVFlwOd8QrcAbkneSsB0/Q7S35KI59Z4897uy7RfBrjLlZlEXJn+IRlkyDjtECJTqr2jj/Xs2UuAwpU8NBRp+Qbgmw3CZ4r5moDP9WxcATySUsLgNzIlGlM8mYoCxc7tsb7dGVBQqozsHML1AK42BZwhnYiwrsbreqqfAJ5yZTYTv5chcSRDs41JuD523NadAaJf3mv3vn786CxMGJOF+lMdONrUmUwQSfallwM+5woNJCqAWCZPg4CdSaIO2n1J0QjcPX5It82+o2FU1oVw5EzETr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4u2Z+7p54A5ewVNYtNX9HoJsycOTBRDODXufGwbgnFEDrLEpySq5rrRSZGWXBYteCRJi6BNBAMunNQKB3anzOOYmC77UU1mMsSspygBOqqgfLLhsCXq3xuRbrxdedATFAUZK9AJYBGK7XSYrsDH8tYjgDukVY0TyRBVpGhKkpCm5wNya/FzItQIxNdAstCM/Yebc4WOTazQ4ErO67vDUyKIanQF/wKf62MQ713HOpFMKKwGNxJC1ADEgTIhvhh1RWC23aR7SCeBN3CpuC851fGxnlpNcBRp25pdZxAqmFAHuYo+V3Zi9fTwHYycD+LIGqquc5TxjlksjesgwYzJF7RZMbAtyCIFzDTGMBHgtgLAgtYGh3EtqviUCNKtTjADc6OtVfdi8YrRVv29r+BTKBrQtOiFe6AAAAAElFTkSuQmCC";

var pauseIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAABrJJREFUeF7lm21sU1UYx//PXbcJQ0d7mREkuixqlqiwRA0MQdqymIAoIOAHooD4Fkkc6R0TSCCMQALK1js00YhRXNTEOExQJBOBtgg6UFFQTAxgggYRYe2GA2EvvY+5hc52Xdt7u1O4y863pv/zvPzuyzn3POcQrkFzqmfLwFQKULEE6XYGFwMoAmAHwQ6GHcBJgE4S8UlN035nSdq51yM3Zzs8yoaDivrQbd1aeJqEnMkMdgK4JUM/IQb2SCTt01hqCiiFJzK0k7SbUADO2tBEytHmgWkegELRwTLQJJHU1IW8rfs8BX+JsC8EgLM+NB0anifwoyKCSmuDcJo17e2wNPSt/oLoF4BrnnhvMjoIYHPAI69JCy2JICMAk9SLI23a5XUgLMrUsch+zNhFGq/yV484aNauaQBONTiHGGsBlJp1lmX9RQCr/IqsmvFjCoDb27KSQXryFm70vl9xzDcaoGEAbrXlJWZ6zajh66z7ya/IY43EYAiA0xusIqDWiEErafyKnDa/tAK3GlzKjI1WSsxoLAzeHlBGPJZKnxKAq651PkhrMOrQijrSuNK3dMTryWJLCsBdF5zAE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T3RZLx/5HTSmN3LHecTALjqQtNArC+RC2t3j7ShvCQXtw7PQeB4Z9oyl64tL8lDWAMCxzqFF0gJtMKnOHqm/gnlcZc3uBnAc8IIWMoQ/XCDzT6hqZI6omElAKhQ/y4Ja7Z9IPF1guvNgpmeClQ5PoiNo889QgNsU6QhrsS0zVflmNVbnHyXWBZXigxFLFZ0lsM0JVDt0Ee5uJYUgLO2pZRySN8pJrxkJjY3Q9Ze8Cuy/m5LaKk3SqrBRWC8Y8iFdUUNfkVOOrSn3SqbzcpR1pkR3vV75GdS+UkLQO88ECEw0BhQ5CfSQTYEYABC2ONXZEO1DsMAIhCse1ok5kJn6cBE1IPVzgvFTWoI1T6PbOpcg6k7INaZSx8hgLVWGCb1550JaiYnTTMGEHkkaltKJYnWZqu0ZuAF1gyG6quSG9Npk/3fLwBRo25v69MMTT8taujFk2mwMf0OAdicbHJjxr4QAFGHrk1tU6CF50HDbJD4o7MENDPwnojEozELBRA16lRbh0MLz5QkaQYzzzRzReK1fIyZvpKAL7VcNAcq5VOZ2+q7Z1YA9HblVFuL0d1dDImKAS6WSBrORHZm2Ak8hIA2ENoAatOYzyCsHerScOjrZUXtohPube8/AMNbG4WK/N0AAAAASUVORK5CYII=";

var audioIcon = "data:image/png;base64,[encoded data, 4516 characters]";

var coverLocal = "5d9cf0a5d487a818.png";

var playRepeat = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAaCAMAAADhRa4NAAAAAXNSR0IArs4c6QAAAi5QTFRFAAAAAID/QID/M5n/JJL/SZL/TYD/O4nrQJ/vR47xQIz/OovoQ5DpPYXrPYX1QJLtPo3tRJDuOI//QI/vOpL4QpLwOZzxQI7qRYr4Po/sPo/zPYztPZL5QIvuQJHuOZL1RI3vPYrwQYzwOY7xQo7sQo3tQpHtPY7vQY7zI4XzPI/wQI/sQZDtSpHtP4/uPo3nPo3xQYvuRoDuQY3vQIn1QI/tOpfxP4zvQY3sKrv1MYv1QJDtQI/tPpLwQJDxQo/s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YnsR4TqR4fqvnKd/wAAAKd0Uk5TAAIECAkLDQ4PERQUFRYXGBsdHyImJykqKisrLS4wMTEzMzQ0NDs7PT1AQURFRklLS0xOUFNVWFxdYWFlZ2doa2xsbW5vb3BxcnJzdHl5fHx8fH+AgIGCg4iJjIyOjpGSkpOUlZeZm56goaKio6OjpKaqqq6vsLO0t7i5vL7GxsfHyMjLy8zN0tTW2trc4ubn6erq7Ozs7Ozu7vHz9Pb3+Pn6+/v9/v6utNnsAAABnklEQVQYGY3BhVsTcQDH4c8QRbCwu7tbVFQsPLu7u3t2YRfYXRhg7r4GMnYzMPm/nLf7nTjkeXxf/lv7I3OoVP+IllCpvg80l39rNiTrkrQymQpqTD4rV7QriabkRx3tnXdP9tQqkDGAP1IPKXw6qy7ZciYCqbLnY6RdkDKBUVI2MUlL39jr8eQV3elATKdTI4kb+6FsMa7NZY/rkWDw8589ielS8qU3FWwquRoAcu0N+Opg3AxNgFalr2rhSd/3qBuece8vwszvOXjGFEiz8dQOC46GRuNK3iMVaDzG+TBct3vgSpGGrpOFse0rPH3blLhGrdkqC2P5OyhUQ3y7ZWEs/AG31RlfUBbGmiLIdQbiC8rC2P8SNkaW4QvKwrgfhkGhu/h2aRKedsVhqGnb/TAOazqend8OAit0BWP4ycbEdXxR2hJIeRJZS6LArc87+K2Xo2n8Len46xsBXAs+fVxFeU3OhJ61wTNL0XPdMarOkPOwLb7M/GIdGNE8rVr1+n1WX3OcYw0oJ32LnKhcjvKGkaDFohOFirm8PQPPL6EvjEOwGD5qAAAAAElFTkSuQmCC";

function parseLrc(lrc_s) {
  if (lrc_s) {
    lrc_s = lrc_s.replace(/([^\]^\n])\[/g, (match, p1) => p1 + '\n[');
    const lyric = lrc_s.split('\n');
    const lrc = [];
    const lyricLen = lyric.length;
    for (let i = 0; i < lyricLen; i++) {
      // match lrc time
      const lrcTimes = lyric[i].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g);
      // match lrc text
      const lrcText = lyric[i].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g, '').replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g, '').replace(/^\s+|\s+$/g, '');
      if (lrcTimes) {
        // handle multiple time tag
        const timeLen = lrcTimes.length;
        for (let j = 0; j < timeLen; j++) {
          const oneTime = /\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/.exec(lrcTimes[j]);
          const min2sec = oneTime[1] * 60;
          const sec2sec = parseInt(oneTime[2]);
          const msec2sec = oneTime[4] ? parseInt(oneTime[4]) / ((oneTime[4] + '').length === 2 ? 100 : 1000) : 0;
          const lrcTime = min2sec + sec2sec + msec2sec;
          lrc.push([lrcTime, lrcText]);
        }
      }
    }
    // sort by time
    lrc.sort((a, b) => a[0] - b[0]);
    return lrc;
  } else {
    return [];
  }
}

//
var script$3 = {
  props: {
    currentMusic: {
      type: Object,
      required: true
    },
    playStat: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      displayLrc: '',
      currentLineIndex: 0
    };
  },
  computed: {
    lrcLines() {
      return parseLrc(this.displayLrc);
    },
    currentLine() {
      if (this.currentLineIndex > this.lrcLines.length - 1) {
        return null;
      }
      return this.lrcLines[this.currentLineIndex];
    },
    transformStyle() {
      // transform: translateY(0); -webkit-transform: translateY(0);
      return {
        transform: `translateY(${-this.currentLineIndex * 16}px)`,
        webkitTransform: `translateY(${-this.currentLineIndex * 16}px)`
      };
    }
  },
  methods: {
    applyLrc(lrc) {
      // if (/^https?:\/\//.test(lrc)) {
      //   this.fetchLrc(lrc)
      // } else {
      //   this.displayLrc = lrc
      // }
      this.fetchLrc(lrc);
    },
    fetchLrc(src) {
      fetch(src).then(response => response.text()).then(lrc => {
        this.displayLrc = lrc;
      });
    },
    hideLrc() {
      this.displayLrc = '';
    }
  },
  watch: {
    currentMusic: {
      deep: true,
      immediate: true,
      handler(music) {
        this.currentLineIndex = 0;
        if (music.lrc) {
          this.applyLrc(music.lrc);
        } else {
          this.hideLrc();
        }
      }
    },
    'playStat.playedTime'(playedTime) {
      for (let i = 0; i < this.lrcLines.length; i++) {
        const line = this.lrcLines[i];
        const nextLine = this.lrcLines[i + 1];
        if (playedTime >= line[0] && (!nextLine || playedTime < nextLine[0])) {
          this.currentLineIndex = i;
        }
      }
    }
  }
};

function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
  if (typeof shadowMode !== 'boolean') {
    createInjectorSSR = createInjector;
    createInjector = shadowMode;
    shadowMode = false;
  }
  // Vue.extend constructor export interop.
  const options = typeof script === 'function' ? script.options : script;
  // render functions
  if (template && template.render) {
    options.render = template.render;
    options.staticRenderFns = template.staticRenderFns;
    options._compiled = true;
    // functional template
    if (isFunctionalTemplate) {
      options.functional = true;
    }
  }
  // scopedId
  if (scopeId) {
    options._scopeId = scopeId;
  }
  let hook;
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context = context ||
      // cached call
      this.$vnode && this.$vnode.ssrContext ||
      // stateful
      this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__;
      }
      // inject component styles
      if (style) {
        style.call(this, createInjectorSSR(context));
      }
      // register component module identifier for async chunk inference
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier);
      }
    };
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook;
  } else if (style) {
    hook = shadowMode ? function (context) {
      style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
    } : function (context) {
      style.call(this, createInjector(context));
    };
  }
  if (hook) {
    if (options.functional) {
      // register for functional component in vue file
      const originalRender = options.render;
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context);
        return originalRender(h, context);
      };
    } else {
      // inject component registration as beforeCreate hook
      const existing = options.beforeCreate;
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
    }
  }
  return script;
}

/* script */
const __vue_script__$3 = script$3;
/* template */
var __vue_render__$3 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "aplayer-lrc" }, [
    _c(
      "div",
      { staticClass: "aplayer-lrc-contents", style: _vm.transformStyle },
      _vm._l(_vm.lrcLines, function (line, index) {
        return _c(
          "p",
          {
            key: index,
            class: { "aplayer-lrc-current": index === _vm.currentLineIndex },
          },
          [_vm._v("\n      " + _vm._s(line[1]) + "\n    ")]
        )
      }),
      0
    ),
  ])
};
var __vue_staticRenderFns__$3 = [];
__vue_render__$3._withStripped = true;

  /* style */
  const __vue_inject_styles__$3 = undefined;
  /* scoped */
  const __vue_scope_id__$3 = undefined;
  /* module identifier */
  const __vue_module_identifier__$3 = undefined;
  /* functional template */
  const __vue_is_functional_template__$3 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$3 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
    __vue_inject_styles__$3,
    __vue_script__$3,
    __vue_scope_id__$3,
    __vue_is_functional_template__$3,
    __vue_module_identifier__$3,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$2 = {
  name: 'XmlAudioModalPlayer',
  components: {
    lyrics: __vue_component__$3
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    playStyle: {
      type: String,
      default: 'yuan-wen'
    },
    styleMode: {
      type: String,
      default: 'A'
    },
    url: {
      type: String,
      default: '',
      require: true
    },
    title: {
      type: String,
      default: '音频文件'
    },
    coverImageUrl: {
      type: String,
      default: ''
    },
    //进度是否能控制
    scheduleControl: {
      type: String,
      default: ''
    },
    loop: {
      type: Boolean,
      default: true
    },
    playMode: {
      type: String,
      default: 'xun-huan'
    },
    content: {
      type: String,
      default: '暂无简介'
    },
    targerLink: {
      type: String,
      default: ''
    },
    subTitle: {
      type: Boolean,
      default: false
    },
    subTitleSrc: {
      type: String,
      default: ''
    },
    subTitleSrcName: {
      type: String,
      default: ''
    }
  },
  computed: {
    videoAndMusicStop() {
      let playState = sessionStorage.getItem('SET_PLAY_STATE');
      return playState;
    },
    playModeIconSrc() {
      let srcMap = {
        'xun-huan': playRepeat,
        'dan-ci': playOnce
      };
      return srcMap[this.playMode];
    }
  },
  watch: {
    url: {
      handler(newVal) {
        let _this = this;
        this.isPlay = false;
        let ua = navigator.userAgent;
        /micromessenger/.test(ua.toLowerCase());
        let isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        if (isIOS && newVal) {
          try {
            this.$nextTick(() => {
              _this.$refs.musicAudio.muted = true;
              const playPromise = _this.$refs.musicAudio.play();
              _this.$refs.musicAudio.muted = false;
              if (playPromise) {
                playPromise.then(() => {
                  _this.$refs.musicAudio.pause();
                }).catch(error => {
                  _this.$refs.musicAudio.pause();
                  console.log(error);
                });
              }
            });
          } catch (error) {
            console.log(error);
            this.$message({
              type: 'warning',
              message: error,
              duration: 5000
            });
          }
        }
      },
      immediate: true
    },
    subTitleSrc: {
      handler(newVal) {
        this.audio.title = this.title;
        this.audio.src = this.url;
        this.audio.pic = this.coverImageUrl || coverLocal;
        this.audio.lrc = newVal;
      },
      immediate: true
    },
    videoAndMusicStop(val) {
      console.log('watch', val);
      let currentPlayStamp = val || '--';
      if (`${this.url}__playTimeStamp__${this.lastOperateTimeStamp}` !== currentPlayStamp) {
        this.musicAudio.pause();
      }
    }
  },
  data() {
    return {
      playIcon,
      pauseIcon,
      audioIcon,
      coverLocal,
      isPlay: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      link: {
        type: String,
        default: ''
      },
      //链接地址
      lastOperateTimeStamp: '',
      musicAudio: null,
      manualPlay: false,
      audio: {
        title: '',
        artist: '',
        src: '',
        pic: '',
        lrc: ''
      },
      playStat: {
        duration: 0,
        loadedTime: 0,
        playedTime: 0
      }
    };
  },
  mounted() {
    // 加载完毕后，先获取<video>标签DOM对象
    this.musicAudio = this.$refs.musicAudio;
    // this.videoContainer = this.$refs.videoContainer
    if (this.mode != 'editor' && this.playStyle === 'yuan-wen') {
      this.$emit('resetTimeUpdate');
    }
  },
  methods: {
    changeDuration() {
      this.$nextTick(() => {
        this.playDuration = this.timeFormat(this.$refs.musicAudio.duration);
        this.totalDuration = this.$refs.musicAudio.duration;
      });
    },
    //将单位为秒的的时间转换成mm:ss的形式
    timeFormat(num) {
      let minute = parseInt(num / 60);
      let second = parseInt(num % 60);
      minute = minute >= 10 ? minute : `0${minute}`;
      second = second >= 10 ? second : `0${second}`;
      return `${minute}:${second}`;
    },
    play() {
      // if (this.mode==='editor') {
      //   this.$message.warning('音频仅支持在预览模式下播放')
      //   return
      // }
      if (this.playStyle === 'yuan-wen') {
        this.doPlay();
      }
      if (this.playStyle === 'tiao-zhuan') {
        if (this.targerLink) {
          // window.location.href=this.targerLink
          window.open(this.targerLink, '_blank');
        } else {
          this.$message.warning('获取资源链接失败，请检查链接地址');
        }
      }
      if (this.playStyle === 'tan-chuang') {
        this.$emit('showDialog', {
          url: this.url,
          title: this.title,
          coverFileUrl: this.coverImageUrl
        });
      }
    },
    doPlay() {
      console.log('暂停');
      let audio = document.querySelectorAll('audio');
      audio.forEach(i => i.pause());
      let video = document.querySelectorAll('video');
      if (video && video.length) {
        video.forEach(i => i.pause());
      }
      if (this.isPlay) {
        this.$refs.musicAudio.pause();
        this.isPlay = !this.isPlay;
      } else {
        this.manualPlay = true;
        this.$refs.musicAudio.play().then(() => {
          this.isPlay = !this.isPlay;
          let timeStamp = new Date().getTime();
          this.lastOperateTimeStamp = timeStamp;
          let playStamp = `${this.url}__playTimeStamp__${timeStamp}`;
          sessionStorage.setItem('SET_PLAY_STATE', playStamp); //存储
        }).catch(error => {
          this.$message.warning('无效音频资源，请检查资源地址');
          console.log('音频播放catch', error);
        });
      }
      // this.isPlay ? this.$refs.musicAudio.pause() : this.$refs.musicAudio.play()
      // this.isPlay = !this.isPlay
      // let timeStamp = new Date().getTime()
      // this.lastOperateTimeStamp = timeStamp
      // let playStamp = `${this.url}__playTimeStamp__${timeStamp}`
      // // !this.isPlay && this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // // this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // sessionStorage.setItem('SET_PLAY_STATE', playStamp) //存储
    },
    updateTime(e) {
      this.playTime = this.$refs.musicAudio.currentTime;
      this.playStat.playedTime = this.$refs.musicAudio.currentTime;
      this.playCurrentTime = this.timeFormat(this.$refs.musicAudio.currentTime);
      if (this.playTime >= this.totalDuration) {
        this.isPlay = false;
      }
      this.$emit('timeUpdate', {
        event: e,
        time: this.$refs.musicAudio.currentTime
      });
    },
    changeTime(val) {
      this.$refs.musicAudio.currentTime = val;
    },
    onPlay() {
      if (!this.manualPlay) {
        this.$refs.musicAudio.pause();
      }
    }
  }
};

/* script */
const __vue_script__$2 = script$2;

/* template */
var __vue_render__$2 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "xml-audio-player" }, [
    _c("div", { staticClass: "audio-cover" }, [
      _c(
        "div",
        { staticClass: "square-wrapper" },
        [
          _c("el-image", {
            attrs: {
              src: _vm.coverImageUrl ? _vm.coverImageUrl : _vm.coverLocal,
              alt: "",
            },
          }),
          _vm._v(" "),
          _c("div", { staticClass: "play-button style-a" }, [
            _c("img", {
              staticClass: "button-image",
              attrs: { src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon },
              on: {
                click: function ($event) {
                  $event.stopPropagation();
                  return _vm.play.apply(null, arguments)
                },
              },
            }),
          ]),
        ],
        1
      ),
    ]),
    _vm._v(" "),
    _c("div", { staticClass: "audio-player-control" }, [
      _c(
        "div",
        {
          class: [
            "audio-player-title",
            "audio-player-title--modal",
            _vm.mode != "editor" && _vm.title.length >= 16 ? "preview" : "",
          ],
        },
        [
          _c(
            "div",
            {
              staticClass: "scroll-text",
              style:
                _vm.mode != "editor" && _vm.title.length >= 16
                  ? {
                      animation:
                        "fadeNum " +
                        _vm.title.length / 3 +
                        "s linear infinite backwards",
                    }
                  : "",
            },
            [_vm._v("\n        " + _vm._s(_vm.title) + "\n      ")]
          ),
          _vm._v(" "),
          _vm.subTitle
            ? _c("lyrics", {
                staticStyle: { "margin-top": "15px" },
                attrs: {
                  "current-music": _vm.audio,
                  "play-stat": _vm.playStat,
                },
              })
            : _vm._e(),
        ],
        1
      ),
      _vm._v(" "),
      _c("div", { staticClass: "audio-controls" }, [
        _c("div", { staticClass: "audio-controls__handler" }, [
          _c("div", { staticClass: "play-times" }, [
            _c("div", { staticClass: "current-time" }, [
              _vm._v(_vm._s(_vm.playCurrentTime)),
            ]),
            _vm._v(" "),
            _c(
              "div",
              { staticClass: "progress" },
              [
                _c("el-slider", {
                  attrs: {
                    max: _vm.totalDuration,
                    disabled: _vm.scheduleControl !== "yes",
                    "show-tooltip": false,
                  },
                  on: { change: _vm.changeTime },
                  model: {
                    value: _vm.playTime,
                    callback: function ($$v) {
                      _vm.playTime = $$v;
                    },
                    expression: "playTime",
                  },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "total-time" }, [
              _vm._v(_vm._s(_vm.playDuration)),
            ]),
          ]),
        ]),
      ]),
      _vm._v(" "),
      _vm.content
        ? _c("div", { staticClass: "content-block" }, [
            _vm._m(0),
            _vm._v(" "),
            _c("div", { staticClass: "content" }, [
              _vm._v(_vm._s(_vm.content || "暂无")),
            ]),
          ])
        : _vm._e(),
    ]),
    _vm._v(" "),
    _c("audio", {
      ref: "musicAudio",
      staticClass: "audio-component",
      attrs: {
        controls: "",
        preload: "auto",
        src: _vm.url,
        loop: _vm.loop,
        link: _vm.link,
      },
      on: {
        canplay: _vm.changeDuration,
        timeupdate: _vm.updateTime,
        pause: function ($event) {
          _vm.isPlay = false;
        },
        play: _vm.onPlay,
      },
    }),
  ])
};
var __vue_staticRenderFns__$2 = [
  function () {
    var _vm = this;
    var _h = _vm.$createElement;
    var _c = _vm._self._c || _h;
    return _c("div", { staticClass: "label" }, [_c("span", [_vm._v("简介")])])
  },
];
__vue_render__$2._withStripped = true;

  /* style */
  const __vue_inject_styles__$2 = undefined;
  /* scoped */
  const __vue_scope_id__$2 = undefined;
  /* module identifier */
  const __vue_module_identifier__$2 = undefined;
  /* functional template */
  const __vue_is_functional_template__$2 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$2 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
    __vue_inject_styles__$2,
    __vue_script__$2,
    __vue_scope_id__$2,
    __vue_is_functional_template__$2,
    __vue_module_identifier__$2,
    false,
    undefined,
    undefined,
    undefined
  );

//
var script$1 = {
  name: 'XmlMusicRender',
  components: {
    XmlAudioModalPlayer: __vue_component__$2
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    //属性中传递过来的块儿数据
    pBlockData: {},
    //块儿数据名
    blockDataName: String,
    //页面类型，取值h5、pc、pad
    pageType: {
      type: String,
      default: 'h5'
    },
    resourceBasisPath: {
      type: String,
      default: ''
    },
    //当前所处组的规则
    currentRule: {
      type: Object,
      default: function () {
        return {};
      }
    },
    ruleIndex: Number,
    extendParams: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  watch: {
    pBlockData: {
      handler(newValue) {
        this.$nextTick(() => {
          console.log('新data', newValue);
          this.blockData = Object.assign({}, this.blockData, newValue);
        });
      },
      deep: true,
      immediate: true
    }
  },
  data() {
    return {
      blockId: 'blockId' + Math.random(),
      //当前块儿数据，一般用不到，因为一般的块儿中不会在块儿内更改数据
      blockData: {
        playMode: 'xun-huan',
        scheduleControl: 'yes',
        playStyle: 'yuan-wen',
        styleMode: 'A'
      },
      //属性组件名
      propertyComponentsName: 'xml-music-property',
      dialogShow: false,
      curMusicUrl: '',
      curSubTitle: '',
      curSubTitleSrcName: '',
      curSubTitleSrc: '',
      curMusicTitle: '',
      curCoverFileUrl: '',
      curMusicContent: '',
      currentPlayer: {},
      modalPlayerKey: 'mpk' + new Date().getTime()
    };
  },
  methods: {
    // 此方法必须要，用户注册块儿点击事件
    blockClick() {
      this.$emit('blockclick', {
        blockData: this.blockData,
        dataName: this.blockDataName,
        propertyComponentsName: this.propertyComponentsName,
        blockId: this.blockId,
        ruleIndex: this.ruleIndex
      });
    },
    showDialog(param) {
      this.curMusicUrl = param.url;
      this.curSubTitle = param.subTitle;
      this.curSubTitleSrc = param.subTitleSrc;
      this.curSubTitleSrcName = param.subTitleSrcName;
      this.curMusicTitle = param.title;
      this.curCoverFileUrl = param.coverFileUrl;
      this.curMusicContent = param.content;
      this.currentPlayer = this.blockData.musicSetList[param.playerIndex];
      this.modalPlayerKey = 'mpk' + new Date().getTime();
      this.$nextTick(() => {
        this.dialogShow = true;
      });
    },
    timeUpdate({
      event,
      time
    }, data) {
      // console.log({event, time, data});
      // this.$EventBus.$emit('audioTimeUpdate', { event, time, data })
      this.$EventBus.$emit('audioTimeUpdate', {
        event,
        time,
        data: {
          ...data,
          chapterId: this.currentRule.chapterId,
          xmlCompRef: this.currentRule.xmlCompRef,
          duration: this.$refs.xmlAudioPlay.totalDuration,
          time
        }
      });
    },
    resetTimeUpdate(data) {
      this.$EventBus.$emit('resetTimeUpdate', data);
    }
  },
  created() {},
  computed: {
    isEmpty() {
      return !(this.blockData.musicSetList && this.blockData.musicSetList.length);
    }
  }
};

/* script */
const __vue_script__$1 = script$1;

/* template */
var __vue_render__$1 = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    {
      staticClass: "xml-music-container",
      class: [
        "xml-music-container-" + _vm.pageType,
        "xml-music-style-mode-" + _vm.blockData.styleMode,
      ],
      attrs: { id: _vm.blockId },
      on: { click: _vm.blockClick },
    },
    [
      _vm.blockData.musicSetList && _vm.blockData.musicSetList.length
        ? _vm._l(_vm.blockData.musicSetList, function (item, index) {
            return _c(
              "div",
              {
                key: index,
                staticClass: "fixed-ratio-container xml-group-item",
              },
              [
                _c(
                  "div",
                  {
                    class: [
                      "xml-music__wrapper",
                      "style-mode--" + _vm.blockData.styleMode,
                      _vm.mode,
                    ],
                  },
                  [
                    _c(
                      "div",
                      { staticClass: "xml-music-player-box" },
                      [
                        _c("xml-audio-play", {
                          ref: "xmlAudioPlay",
                          refInFor: true,
                          attrs: {
                            "targer-link": item.link,
                            mode: _vm.mode,
                            styleMode: _vm.blockData.styleMode,
                            "play-style": _vm.blockData.playStyle,
                            "play-mode": _vm.blockData.playMode,
                            url: item.uploadFileUrl
                              ? _vm.resourceBasisPath
                                ? _vm.resourceBasisPath +
                                  item.uploadFileUrl.split("./")[1]
                                : item.uploadFileUrl
                              : "",
                            loop: _vm.blockData.playMode === "xun-huan",
                            title: item.title,
                            playerIndex: index,
                            content: item.content,
                            scheduleControl: _vm.blockData.scheduleControl,
                            subTitle: _vm.blockData.subTitle == "showSubtitle",
                            subTitleSrcName: item.subTitleSrcName,
                            subTitleSrc: item.subTitleSrc,
                            "cover-image-url": item.coverFileUrl
                              ? _vm.resourceBasisPath
                                ? _vm.resourceBasisPath +
                                  item.coverFileUrl.split("./")[1]
                                : item.coverFileUrl
                              : "",
                          },
                          on: {
                            showDialog: _vm.showDialog,
                            timeUpdate: function (e) {
                              return _vm.timeUpdate(e, item)
                            },
                            resetTimeUpdate: function ($event) {
                              return _vm.resetTimeUpdate(item)
                            },
                          },
                        }),
                      ],
                      1
                    ),
                  ]
                ),
              ]
            )
          })
        : [
            _c("div", { staticClass: "fixed-ratio-container" }, [
              _c(
                "div",
                {
                  class: [
                    "xml-music__wrapper",
                    "style-mode--" + _vm.blockData.styleMode,
                    _vm.mode,
                  ],
                },
                [
                  _c(
                    "div",
                    { staticClass: "xml-music-player-box" },
                    [
                      _c("xml-audio-play", {
                        attrs: {
                          mode: _vm.mode,
                          styleMode: _vm.blockData.styleMode,
                          "play-mode": _vm.blockData.playMode,
                          title: "这是音频",
                        },
                      }),
                    ],
                    1
                  ),
                ]
              ),
            ]),
          ],
      _vm._v(" "),
      _c(
        "el-dialog",
        {
          staticClass: "resource-preview player-dialog",
          attrs: {
            title: "",
            visible: _vm.dialogShow,
            "destroy-on-close": true,
            width: "100%",
            modal: false,
            "show-close": false,
            "append-to-body": "",
            "custom-class": "preview-modal-music",
            "close-on-click-modal": true,
          },
          on: {
            "update:visible": function ($event) {
              _vm.dialogShow = $event;
            },
          },
        },
        [
          _c(
            "div",
            { staticClass: "xml-modal-player__wrapper" },
            [
              _c("xml-audio-modal-player", {
                key: _vm.modalPlayerKey,
                attrs: {
                  mode: _vm.mode,
                  styleMode: _vm.blockData.styleMode,
                  "play-style": "yuan-wen",
                  "play-mode": _vm.blockData.playMode,
                  url: _vm.curMusicUrl,
                  loop: _vm.blockData.playMode === "xun-huan",
                  title: _vm.curMusicTitle,
                  content: _vm.curMusicContent,
                  scheduleControl: _vm.blockData.scheduleControl,
                  "cover-image-url": _vm.curCoverFileUrl,
                  subTitle: _vm.curSubTitle,
                  subTitleSrcName: _vm.curSubTitleSrcName,
                  subTitleSrc: _vm.curSubTitleSrc,
                },
                on: {
                  timeUpdate: function (e) {
                    return _vm.timeUpdate(e, _vm.currentPlayer)
                  },
                  resetTimeUpdate: function ($event) {
                    return _vm.resetTimeUpdate(_vm.currentPlayer)
                  },
                },
              }),
            ],
            1
          ),
        ]
      ),
    ],
    2
  )
};
var __vue_staticRenderFns__$1 = [];
__vue_render__$1._withStripped = true;

  /* style */
  const __vue_inject_styles__$1 = undefined;
  /* scoped */
  const __vue_scope_id__$1 = undefined;
  /* module identifier */
  const __vue_module_identifier__$1 = undefined;
  /* functional template */
  const __vue_is_functional_template__$1 = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__$1 = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
    __vue_inject_styles__$1,
    __vue_script__$1,
    __vue_scope_id__$1,
    __vue_is_functional_template__$1,
    __vue_module_identifier__$1,
    false,
    undefined,
    undefined,
    undefined
  );

var playIcon2 = "data:image/png;base64,[encoded data, 5428 characters]";

var pauseIcon2 = "data:image/png;base64,[encoded data, 5180 characters]";

var recordIcon = "data:image/png;base64,[encoded data, 15340 characters]";

//
var script = {
  name: 'AudioPlay',
  components: {
    lyrics: __vue_component__$3
  },
  props: {
    //模式：preview 预览 (默认)，editor 编辑
    mode: {
      type: String,
      default: 'editor'
    },
    playStyle: {
      type: String,
      default: 'yuan-wen'
    },
    styleMode: {
      type: String,
      default: 'A'
    },
    url: {
      type: String,
      default: '',
      require: true
    },
    title: {
      type: String,
      default: '音频文件'
    },
    content: {
      type: String,
      default: '暂无简介'
    },
    coverImageUrl: {
      type: String,
      default: ''
    },
    //进度是否能控制
    scheduleControl: {
      type: String,
      default: ''
    },
    loop: {
      type: Boolean,
      default: true
    },
    playMode: {
      type: String,
      default: 'xun-huan'
    },
    targerLink: {
      type: String,
      default: ''
    },
    playerIndex: {
      type: Number,
      default: -1
    },
    subTitle: {
      type: Boolean,
      default: false
    },
    subTitleSrc: {
      type: String,
      default: ''
    },
    subTitleSrcName: {
      type: String,
      default: ''
    }
  },
  computed: {
    videoAndMusicStop() {
      let playState = sessionStorage.getItem('SET_PLAY_STATE');
      return playState;
    },
    playModeIconSrc() {
      let srcMap = {
        'xun-huan': playRepeat,
        'dan-ci': playOnce
      };
      return srcMap[this.playMode];
    }
  },
  watch: {
    url: {
      handler(newVal) {
        let _this = this;
        this.isPlay = false;
        let ua = navigator.userAgent;
        console.log('浏览器 UA', ua);
        /micromessenger/.test(ua.toLowerCase());
        let isIOS = !!ua.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        // isWeixin && isIOS && newVal && this.$message({
        //   message: `当前UA为${ua}`,
        //   duration: 3000
        // })
        if (isIOS && newVal) {
          try {
            this.$nextTick(() => {
              _this.$refs.musicAudio.muted = true;
              const playPromise = _this.$refs.musicAudio.play();
              _this.$refs.musicAudio.muted = false;
              if (playPromise) {
                playPromise.then(() => {
                  _this.$refs.musicAudio.pause();
                }).catch(error => {
                  _this.$refs.musicAudio.pause();
                  console.log(error);
                });
              }
            });
          } catch (error) {
            console.log(error);
            this.$message({
              type: 'warning',
              message: error,
              duration: 5000
            });
          }
        }
      },
      immediate: true
    },
    subTitleSrc: {
      handler(newVal) {
        this.audio.title = this.title;
        this.audio.src = this.url;
        this.audio.pic = this.coverImageUrl || coverLocal;
        this.audio.lrc = newVal;
      },
      immediate: true
    },
    videoAndMusicStop(val) {
      console.log('watch', val);
      let currentPlayStamp = val || '--';
      if (`${this.url}__playTimeStamp__${this.lastOperateTimeStamp}` !== currentPlayStamp) {
        this.musicAudio.pause();
      }
    }
  },
  data() {
    return {
      playIcon,
      playIcon2,
      pauseIcon,
      pauseIcon2,
      audioIcon,
      coverLocal,
      recordIcon,
      isPlay: false,
      playTime: 0,
      playDuration: '00:00',
      playCurrentTime: '00:00',
      totalDuration: 0,
      link: {
        type: String,
        default: ''
      },
      //链接地址
      lastOperateTimeStamp: '',
      musicAudio: null,
      manualPlay: false,
      Volume: 100,
      //音量
      doubleSpeed: 1,
      //倍速
      audio: {
        title: '',
        artist: '',
        src: '',
        pic: '',
        lrc: ''
      },
      playStat: {
        duration: 0,
        loadedTime: 0,
        playedTime: 0
      }
    };
  },
  mounted() {
    // 加载完毕后，先获取<video>标签DOM对象
    this.musicAudio = this.$refs.musicAudio;
    // this.videoContainer = this.$refs.videoContainer
    if (this.mode != 'editor' && this.playStyle === 'yuan-wen') {
      this.$emit('resetTimeUpdate');
    }
  },
  methods: {
    changeDuration() {
      this.$nextTick(() => {
        this.playDuration = this.timeFormat(this.$refs.musicAudio.duration);
        this.totalDuration = this.$refs.musicAudio.duration;
      });
    },
    //将单位为秒的的时间转换成mm:ss的形式
    timeFormat(num) {
      let minute = parseInt(num / 60);
      let second = parseInt(num % 60);
      minute = minute >= 10 ? minute : `0${minute}`;
      second = second >= 10 ? second : `0${second}`;
      return `${minute}:${second}`;
    },
    play() {
      // if (this.mode==='editor') {
      //   this.$message.warning('音频仅支持在预览模式下播放')
      //   return
      // }
      if (this.playStyle === 'yuan-wen') {
        this.doPlay();
      }
      if (this.playStyle === 'tiao-zhuan') {
        if (this.targerLink) {
          // window.location.href=this.targerLink
          window.open(this.targerLink, '_blank');
        } else {
          this.$message.warning('获取资源链接失败，请检查链接地址');
        }
      }
      if (this.playStyle === 'tan-chuang') {
        this.$emit('showDialog', {
          url: this.url,
          title: this.title,
          coverFileUrl: this.coverImageUrl,
          content: this.content,
          playerIndex: this.playerIndex,
          subTitle: this.subTitle,
          subTitleSrc: this.subTitleSrc,
          subTitleSrcName: this.subTitleSrcName
        });
      }
    },
    doPlay() {
      let audio = document.querySelectorAll('audio');
      audio.forEach(i => i.pause());
      let video = document.querySelectorAll('video');
      if (video && video.length) {
        video.forEach(i => i.pause());
      }
      if (this.isPlay) {
        this.$refs.musicAudio.pause();
        this.isPlay = !this.isPlay;
      } else {
        this.manualPlay = true;
        this.$refs.musicAudio.play().then(() => {
          this.isPlay = !this.isPlay;
          let timeStamp = new Date().getTime();
          this.lastOperateTimeStamp = timeStamp;
          let playStamp = `${this.url}__playTimeStamp__${timeStamp}`;
          sessionStorage.setItem('SET_PLAY_STATE', playStamp); //存储
        }).catch(error => {
          this.$message.warning('无效音频资源，请检查资源地址');
          console.log('音频播放catch', error);
        });
      }
      // this.isPlay ? this.$refs.musicAudio.pause() : this.$refs.musicAudio.play()
      // this.isPlay = !this.isPlay
      // let timeStamp = new Date().getTime()
      // this.lastOperateTimeStamp = timeStamp
      // let playStamp = `${this.url}__playTimeStamp__${timeStamp}`
      // // !this.isPlay && this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // // this.$store.commit('leaflet/SET_PLAY_STATE', playStamp)
      // sessionStorage.setItem('SET_PLAY_STATE', playStamp) //存储
    },
    updateTime(e) {
      this.playTime = this.$refs.musicAudio.currentTime;
      this.playStat.playedTime = this.$refs.musicAudio.currentTime;
      this.playCurrentTime = this.timeFormat(this.$refs.musicAudio.currentTime);
      if (this.playTime >= this.totalDuration) {
        this.isPlay = false;
      }
      this.$emit('timeUpdate', {
        event: e,
        time: this.$refs.musicAudio.currentTime
      });
    },
    changeTime(val) {
      this.$refs.musicAudio.currentTime = val;
    },
    onPlay() {
      if (!this.manualPlay) {
        this.$refs.musicAudio.pause();
      }
    },
    changeVolume(val) {
      this.$refs.musicAudio.volume = val / 100;
    },
    changeDoubleSpeed() {
      if (this.doubleSpeed == 1) {
        this.doubleSpeed = 1.25;
      } else if (this.doubleSpeed == 1.25) {
        this.doubleSpeed = 1.5;
      } else if (this.doubleSpeed == 1.5) {
        this.doubleSpeed = 2;
      } else if (this.doubleSpeed == 2) {
        this.doubleSpeed = 0.5;
      } else if (this.doubleSpeed == 0.5) {
        this.doubleSpeed = 1;
      }
      this.$refs.musicAudio.playbackRate = this.doubleSpeed;
    }
  }
};

/* script */
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c(
    "div",
    { class: ["xml-audio-player", _vm.mode] },
    [
      _vm.styleMode == "A" || _vm.styleMode == "B" || _vm.styleMode == "C"
        ? _c("div", { staticClass: "play-mode-wrap" }, [
            _c("img", {
              staticClass: "play-control-image",
              attrs: { src: _vm.playModeIconSrc },
            }),
          ])
        : _vm._e(),
      _vm._v(" "),
      _vm.styleMode == "A" || _vm.styleMode == "B" || _vm.styleMode == "C"
        ? _c("div", { staticStyle: { width: "100%", display: "flex" } }, [
            _vm.styleMode !== "C"
              ? _c(
                  "div",
                  { staticClass: "audio-cover" },
                  [
                    _c("el-image", {
                      staticClass: "xml-round-6",
                      attrs: {
                        src: _vm.coverImageUrl
                          ? _vm.coverImageUrl
                          : _vm.coverLocal,
                        alt: "",
                      },
                    }),
                    _vm._v(" "),
                    _vm.styleMode === "A"
                      ? _c("div", { staticClass: "play-button style-a" }, [
                          _c("img", {
                            staticClass: "button-image",
                            attrs: {
                              src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon,
                            },
                            on: {
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.play.apply(null, arguments)
                              },
                            },
                          }),
                        ])
                      : _vm._e(),
                  ],
                  1
                )
              : _vm._e(),
            _vm._v(" "),
            _c("div", { staticClass: "audio-player-control" }, [
              _c(
                "div",
                {
                  class: [
                    "audio-player-title",
                    _vm.mode != "editor" && _vm.title.length >= 16
                      ? "preview"
                      : "",
                  ],
                },
                [
                  _c(
                    "div",
                    {
                      staticClass: "xml-audio-title scroll-text",
                      style:
                        _vm.mode != "editor" && _vm.title.length >= 16
                          ? {
                              animation:
                                "fadeNum " +
                                _vm.title.length / 3 +
                                "s linear infinite backwards",
                            }
                          : "",
                    },
                    [
                      _vm._v(
                        "\n            " + _vm._s(_vm.title) + "\n          "
                      ),
                    ]
                  ),
                ]
              ),
              _vm._v(" "),
              _c("div", { staticClass: "audio-controls" }, [
                _vm.styleMode !== "A"
                  ? _c(
                      "div",
                      { staticClass: "audio-controls__play-button-wrapper" },
                      [
                        _c("div", { staticClass: "play-button" }, [
                          _c("img", {
                            staticClass: "button-image",
                            attrs: {
                              src: _vm.isPlay ? _vm.pauseIcon : _vm.playIcon,
                            },
                            on: {
                              click: function ($event) {
                                $event.stopPropagation();
                                return _vm.play.apply(null, arguments)
                              },
                            },
                          }),
                        ]),
                      ]
                    )
                  : _vm._e(),
                _vm._v(" "),
                _c("div", { staticClass: "audio-controls__handler" }, [
                  _c(
                    "div",
                    { staticClass: "progress" },
                    [
                      _vm.subTitle
                        ? _c("lyrics", {
                            staticStyle: { "margin-top": "-25px" },
                            attrs: {
                              "current-music": _vm.audio,
                              "play-stat": _vm.playStat,
                            },
                          })
                        : _vm._e(),
                      _vm._v(" "),
                      _c("el-slider", {
                        attrs: {
                          max: _vm.totalDuration,
                          disabled: _vm.scheduleControl !== "yes",
                          "show-tooltip": false,
                        },
                        on: { change: _vm.changeTime },
                        model: {
                          value: _vm.playTime,
                          callback: function ($$v) {
                            _vm.playTime = $$v;
                          },
                          expression: "playTime",
                        },
                      }),
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c("div", { staticClass: "play-times" }, [
                    _c("div", { staticClass: "current-time" }, [
                      _vm._v(_vm._s(_vm.playCurrentTime)),
                    ]),
                    _vm._v(" "),
                    _c("div", { staticClass: "total-time" }, [
                      _vm._v(_vm._s(_vm.playDuration)),
                    ]),
                  ]),
                ]),
              ]),
            ]),
          ])
        : _vm.styleMode == "D"
        ? _c("div", { staticClass: "audio-play-box" }, [
            _c(
              "div",
              { staticClass: "audio-cover" },
              [
                _c("div", { staticClass: "video-pause-btn" }, [
                  _c(
                    "div",
                    { staticClass: "audio-controls__play-button-wrapper" },
                    [
                      _c("div", { staticClass: "play-button" }, [
                        _c("img", {
                          staticClass: "button-image",
                          attrs: {
                            src: _vm.isPlay ? _vm.pauseIcon2 : _vm.playIcon2,
                          },
                          on: {
                            click: function ($event) {
                              $event.stopPropagation();
                              return _vm.play.apply(null, arguments)
                            },
                          },
                        }),
                      ]),
                    ]
                  ),
                ]),
                _vm._v(" "),
                _c("el-image", {
                  staticClass: "xml-round-6",
                  attrs: { src: _vm.recordIcon, alt: "" },
                }),
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "audio-player-control" }, [
              _c(
                "div",
                {
                  class: [
                    "audio-player-title",
                    _vm.mode != "editor" && _vm.title.length >= 16
                      ? "preview"
                      : "",
                  ],
                },
                [
                  _c(
                    "div",
                    {
                      staticClass: "xml-audio-title scroll-text",
                      style:
                        _vm.mode != "editor" && _vm.title.length >= 16
                          ? {
                              animation:
                                "fadeNum " +
                                _vm.title.length / 3 +
                                "s linear infinite backwards",
                            }
                          : "",
                    },
                    [_vm._v("\n          " + _vm._s(_vm.title) + "\n        ")]
                  ),
                ]
              ),
              _vm._v(" "),
              _c("div", { staticClass: "audio-controls" }, [
                _c("div", { staticClass: "audio-controls__handler" }, [
                  _c(
                    "div",
                    { staticClass: "progress" },
                    [
                      _vm.subTitle
                        ? _c("lyrics", {
                            staticStyle: { "margin-top": "-25px" },
                            attrs: {
                              "current-music": _vm.audio,
                              "play-stat": _vm.playStat,
                            },
                          })
                        : _vm._e(),
                      _vm._v(" "),
                      _c("el-slider", {
                        attrs: {
                          max: _vm.totalDuration,
                          disabled: _vm.scheduleControl !== "yes",
                          "show-tooltip": false,
                          "tooltip-class": "silder-bg",
                        },
                        on: { change: _vm.changeTime },
                        model: {
                          value: _vm.playTime,
                          callback: function ($$v) {
                            _vm.playTime = $$v;
                          },
                          expression: "playTime",
                        },
                      }),
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c("div", { staticClass: "play-times" }, [
                    _c("div", { staticClass: "current-time" }, [
                      _vm._v(_vm._s(_vm.playCurrentTime)),
                    ]),
                    _vm._v(" "),
                    _c("div", { staticClass: "total-time" }, [
                      _vm._v(_vm._s(_vm.playDuration)),
                    ]),
                  ]),
                ]),
              ]),
            ]),
          ])
        : _vm.styleMode == "E"
        ? _c("div", { staticClass: "styleModeE_content" }, [
            _c("div", { staticClass: "styleModeE_title" }, [
              _vm._v(_vm._s(_vm.title)),
            ]),
            _vm._v(" "),
            _c("div", { staticClass: "styleModeE_row" }, [
              _c(
                "div",
                {
                  staticStyle: { cursor: "pointer" },
                  on: {
                    click: function ($event) {
                      $event.stopPropagation();
                      return _vm.play.apply(null, arguments)
                    },
                  },
                },
                [
                  _vm.isPlay
                    ? _c("i", {
                        staticClass: "el-icon-video-pause",
                        staticStyle: { "font-size": "28px" },
                      })
                    : _c("i", {
                        staticClass: "el-icon-caret-right",
                        staticStyle: { "font-size": "28px" },
                      }),
                ]
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "styleModeE_progress" },
                [
                  _vm.subTitle
                    ? _c("lyrics", {
                        staticStyle: { "margin-top": "-25px" },
                        attrs: {
                          "current-music": _vm.audio,
                          "play-stat": _vm.playStat,
                        },
                      })
                    : _vm._e(),
                  _vm._v(" "),
                  _c("el-slider", {
                    attrs: {
                      max: _vm.totalDuration,
                      disabled: _vm.scheduleControl !== "yes",
                      "show-tooltip": false,
                    },
                    on: { change: _vm.changeTime },
                    model: {
                      value: _vm.playTime,
                      callback: function ($$v) {
                        _vm.playTime = $$v;
                      },
                      expression: "playTime",
                    },
                  }),
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                {
                  staticStyle: {
                    display: "flex",
                    "flex-direction": "row",
                    "align-items": "center",
                  },
                },
                [
                  _c("div", [
                    _vm._v(
                      _vm._s(_vm.playCurrentTime) +
                        "/ " +
                        _vm._s(_vm.playDuration)
                    ),
                  ]),
                  _vm._v(" "),
                  _c(
                    "el-popover",
                    {
                      attrs: {
                        placement: "bottom",
                        width: "200",
                        trigger: "click",
                      },
                    },
                    [
                      _c(
                        "div",
                        [
                          _c("el-slider", {
                            attrs: { "show-tooltip": false },
                            on: { change: _vm.changeVolume },
                            model: {
                              value: _vm.Volume,
                              callback: function ($$v) {
                                _vm.Volume = $$v;
                              },
                              expression: "Volume",
                            },
                          }),
                        ],
                        1
                      ),
                      _vm._v(" "),
                      _c("i", {
                        staticClass: "el-icon-s-tools",
                        staticStyle: {
                          "font-size": "18px",
                          "margin-left": "15px",
                          cursor: "pointer",
                        },
                        attrs: { slot: "reference" },
                        slot: "reference",
                      }),
                    ]
                  ),
                ],
                1
              ),
            ]),
          ])
        : _vm.styleMode == "F"
        ? [
            _c("div", { staticClass: "styleModeF_row styleModeF_content" }, [
              _c("div", { staticStyle: { position: "relative" } }, [
                _c("div", { staticClass: "styleModeF_IMG" }, [
                  _c("img", {
                    attrs: {
                      src: _vm.coverImageUrl
                        ? _vm.coverImageUrl
                        : _vm.coverLocal,
                      alt: "",
                    },
                  }),
                ]),
                _vm._v(" "),
                _vm.isPlay
                  ? _c("i", {
                      staticClass: "el-icon-video-pause styleModeF_I",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.play.apply(null, arguments)
                        },
                      },
                    })
                  : _c("i", {
                      staticClass: "el-icon-video-play styleModeF_I",
                      on: {
                        click: function ($event) {
                          $event.stopPropagation();
                          return _vm.play.apply(null, arguments)
                        },
                      },
                    }),
              ]),
              _vm._v(" "),
              _c(
                "div",
                { staticStyle: { "margin-left": "20px", width: "100%" } },
                [
                  _c("div", { staticClass: "styleModeF_row" }, [
                    _c(
                      "div",
                      {
                        staticStyle: { cursor: "pointer" },
                        on: {
                          click: function ($event) {
                            $event.stopPropagation();
                            return _vm.play.apply(null, arguments)
                          },
                        },
                      },
                      [
                        _vm.isPlay
                          ? _c("i", {
                              staticClass: "el-icon-video-pause",
                              staticStyle: { "font-size": "28px" },
                            })
                          : _c("i", {
                              staticClass: "el-icon-caret-right",
                              staticStyle: { "font-size": "28px" },
                            }),
                      ]
                    ),
                    _vm._v(" "),
                    _c(
                      "div",
                      { staticClass: "styleModeF_progress" },
                      [
                        _c("el-slider", {
                          attrs: {
                            max: _vm.totalDuration,
                            disabled: _vm.scheduleControl !== "yes",
                            "show-tooltip": false,
                          },
                          on: { change: _vm.changeTime },
                          model: {
                            value: _vm.playTime,
                            callback: function ($$v) {
                              _vm.playTime = $$v;
                            },
                            expression: "playTime",
                          },
                        }),
                      ],
                      1
                    ),
                    _vm._v(" "),
                    _c(
                      "div",
                      {
                        staticStyle: {
                          display: "flex",
                          "flex-direction": "row",
                          "align-items": "center",
                        },
                      },
                      [
                        _c("div", [
                          _vm._v(
                            _vm._s(_vm.playCurrentTime) +
                              " / " +
                              _vm._s(_vm.playDuration)
                          ),
                        ]),
                        _vm._v(" "),
                        _c(
                          "el-popover",
                          {
                            attrs: {
                              placement: "bottom",
                              width: "200",
                              trigger: "click",
                            },
                          },
                          [
                            _c(
                              "div",
                              [
                                _c("el-slider", {
                                  attrs: { "show-tooltip": false },
                                  on: { change: _vm.changeVolume },
                                  model: {
                                    value: _vm.Volume,
                                    callback: function ($$v) {
                                      _vm.Volume = $$v;
                                    },
                                    expression: "Volume",
                                  },
                                }),
                              ],
                              1
                            ),
                            _vm._v(" "),
                            _c("i", {
                              staticClass: "el-icon-s-tools",
                              staticStyle: {
                                "font-size": "18px",
                                "margin-left": "15px",
                                cursor: "pointer",
                              },
                              attrs: { slot: "reference" },
                              slot: "reference",
                            }),
                          ]
                        ),
                      ],
                      1
                    ),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "styleModeF_title" }, [
                    _vm._v("当前倍速："),
                    _c(
                      "span",
                      {
                        staticStyle: { cursor: "pointer" },
                        on: { click: _vm.changeDoubleSpeed },
                      },
                      [_vm._v("X" + _vm._s(_vm.doubleSpeed))]
                    ),
                  ]),
                  _vm._v(" "),
                  _c("div", { staticClass: "styleModeF_title" }, [
                    _vm._v("\n          " + _vm._s(_vm.title) + "\n        "),
                  ]),
                  _vm._v(" "),
                  _vm.subTitle
                    ? _c("lyrics", {
                        staticStyle: { "margin-top": "10px" },
                        attrs: {
                          "current-music": _vm.audio,
                          "play-stat": _vm.playStat,
                        },
                      })
                    : _vm._e(),
                ],
                1
              ),
            ]),
          ]
        : _vm._e(),
      _vm._v(" "),
      _c("audio", {
        ref: "musicAudio",
        staticClass: "audio-component",
        attrs: {
          controls: "",
          preload: "auto",
          src: _vm.url,
          loop: _vm.loop,
          link: _vm.link,
        },
        on: {
          canplay: _vm.changeDuration,
          timeupdate: _vm.updateTime,
          pause: function ($event) {
            _vm.isPlay = false;
          },
          play: _vm.onPlay,
        },
      }),
    ],
    2
  )
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;

  /* style */
  const __vue_inject_styles__ = undefined;
  /* scoped */
  const __vue_scope_id__ = undefined;
  /* module identifier */
  const __vue_module_identifier__ = undefined;
  /* functional template */
  const __vue_is_functional_template__ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__ = /*#__PURE__*/normalizeComponent(
    { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
    __vue_inject_styles__,
    __vue_script__,
    __vue_scope_id__,
    __vue_is_functional_template__,
    __vue_module_identifier__,
    false,
    undefined,
    undefined,
    undefined
  );

const MusicComponents = [__vue_component__$1, __vue_component__];
var index = {
  ...MusicComponents
};

export { index as default };
