APlayer icon indicating copy to clipboard operation
APlayer copied to clipboard

dynamic update lyric. 动态更新歌词

Open jsbxyyx opened this issue 1 year ago • 2 comments

中文用户请注意:请尽量用英文描述你的 issue,这样能够让尽可能多的人帮到你。

If you want to report a bug, please provide the following information:

  • The steps to reproduce.
  • A minimal demo of the problem via https://jsfiddle.net or http://codepen.io/pen if possible.
  • Which versions of APlayer, and which browser / OS are affected by this issue?

jsbxyyx avatar Feb 04 '24 07:02 jsbxyyx

function updateLyric(lyric) {
  var index = window.ap.list.index;
  window.ap.lrc.parsed[index] = window.ap.lrc.parse(lyric);
  var html = '';
  for (var idx in window.ap.lrc.parsed[index]) {
    var value = window.ap.lrc.parsed[index][idx];
    if (idx == 0) {
      html += '<p class="aplayer-lrc-current">' + value[1] + '</p>';
    } else {
      html += '<p>' + value[1] + '</p>';
    }
  }
  window.ap.lrc.container.innerHTML = html;
  window.ap.lrc.update(0);
  window.ap.lrc.current = window.ap.lrc.parsed[index];
}

jsbxyyx avatar Feb 04 '24 07:02 jsbxyyx

function updateLyric(lyric) {
  var index = window.ap.list.index;
  window.ap.lrc.parsed[index] = window.ap.lrc.parse(lyric);
  var html = '';
  for (var idx in window.ap.lrc.parsed[index]) {
    var value = window.ap.lrc.parsed[index][idx];
    if (idx == 0) {
      html += '<p class="aplayer-lrc-current">' + value[1] + '</p>';
    } else {
      html += '<p>' + value[1] + '</p>';
    }
  }
  window.ap.lrc.container.innerHTML = html;
  window.ap.lrc.update(0);
  window.ap.lrc.current = window.ap.lrc.parsed[index];
}

what is this. dont get it

Denghongjian233 avatar May 24 '24 04:05 Denghongjian233