GithubHelp home page GithubHelp logo

The player cannot adjust the number and size of lines displayed in the lyrics, only one or two lines can be viewed播放器无法调整歌词显示的行数和大小,只能看一两行 about aplayer HOT 2 CLOSED

RickyWang111 avatar RickyWang111 commented on June 11, 2024
The player cannot adjust the number and size of lines displayed in the lyrics, only one or two lines can be viewed播放器无法调整歌词显示的行数和大小,只能看一两行

from aplayer.

Comments (2)

RickyWang111 avatar RickyWang111 commented on June 11, 2024

Here is my code:
以下是我的代码:

<link rel="stylesheet" href="/static/css/APlayer.min.css">
<script src="/static/js/APlayer.min.js"></script>

<div>
  <table>
    <tr>
      <td style="text-align: center;">啊啊啊</td>
      <td>
        <div id="aplayer" style="width: 100%;margin:auto,height:600px;"></div></td>
      <td style="text-align: center;"> 

        <div id="player">
          <pre class="aplayer-lrc-content">
              [00:00.00]APlayer audio1
              [00:04.01]is
              [00:08.02]amazing
              <!-- ... -->
          </pre>
          <pre class="aplayer-lrc-content">
              [00:00.00]APlayer audio2
              [00:04.01]is
              [00:08.02]amazing
              <!-- ... -->
          </pre>
      </div>
      
      </td>
    </tr>
  </table>
</div>

<script>
const ap = new APlayer({
    container: document.getElementById('aplayer'),
    lrcType: 1,
    audio: [{
        name: '雨后',
        artist: '123',
        url: 'http://s-cd-7880-music.oss.dogecdn.com/100001.mp3',
        cover: '/static/img/logo73.jpg',
    },{
        name: '老去',
        artist: '123',
        url: 'url.mp3',
        cover: '/static/img/logo73.jpg'
    },
  ]
});
ap.on('play', function (e) {
  console.log(e);
  if(ap.list.audios[ap.list.index].name=="雨后"){

  }
  ;
})
</script>

page display
页面显示:

image

from aplayer.

RickyWang111 avatar RickyWang111 commented on June 11, 2024

我解决了部分问题。
说明文档里面的id="player" 少了个a
应该是id="aplayer"

但是歌词只能显示1-2行,希望能改进为显示10行,播放器歌词部分显示多点,这样听众可以多看看歌词上下文
image

或者可以把歌词部分自定义到任意位置

from aplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.