Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic update lyric. 动态更新歌词 #790

Open
jsbxyyx opened this issue Feb 4, 2024 · 2 comments
Open

dynamic update lyric. 动态更新歌词 #790

jsbxyyx opened this issue Feb 4, 2024 · 2 comments

Comments

@jsbxyyx
Copy link

jsbxyyx commented Feb 4, 2024

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

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

@jsbxyyx
Copy link
Author

jsbxyyx commented Feb 4, 2024

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 jsbxyyx changed the title 动态更新歌词 dynamic update lyric. 动态更新歌词 Feb 4, 2024
@Denghongjian233
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants