GithubHelp home page GithubHelp logo

diygod / aplayer Goto Github PK

View Code? Open in Web Editor NEW
7.1K 144.0 999.0 20.7 MB

:lollipop: Wow, such a beautiful HTML5 music player

Home Page: http://aplayer.js.org

License: MIT License

JavaScript 75.14% SCSS 24.86%
aplayer music player html html5

aplayer's People

Contributors

argvil19 avatar bugkiwi avatar cee avatar dependabot-preview[bot] avatar diygod avatar dongyuanxin avatar ericdrobinson avatar garniersam avatar geekrainy avatar hitsuki9 avatar kn007 avatar liwanglin12 avatar miaoyuxinbaby avatar micooz avatar mpierre9 avatar remyabel2 avatar sabrinaluo avatar sevenoutman avatar soptq avatar yodagg avatar zanseven007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aplayer's Issues

Add a download icon.

some times we need a download button at the playlist, users can using this button to download the mp3.

How to pause all musics on a page

Hi all,
I want change url of a player by ajax reponse, but after load old audio still play, i mean too audios play same time.
How to pause all musics on a page?

Thanks.

A Problem about "border-box"

Here is a Problem because of Bootstrap and other frontend frames.

It can make the player interface dystopic.

This is an answer to the problem:

.aplayer * {
    box-sizing: content-box;
}

HTML Div ID的排序问题

我发现 一个页面div的id必须从player1起才能显示,就比如如果一个页面只有div id="player3" class="aplayer">这行就无法显示播放器了。如果想要调用player3就必须调用player1,player2才行,这是bug吗?

improve UI

  1. click play list: toggle between play and pause
  2. click picture: toggle between play and pause
  3. more bolder play bar when hoverd or showed in mobile
  4. hide buttons in narrow screen
  5. adjust the position of lrc: below the picture
  6. lrc rolling display
  7. lrc show button
  8. isMobile add wp

手机浏览器中不自动播放

即便是在init参数中将autoplay设置为true也不能自动播放;甚至在init()后再次调用play()方法也不行。

上述问题在PC浏览器不存在,在手机上会发生(安卓和iOS局势如此)。

求解决办法,多谢!

The player can't auto play in mobile bowser. Even set init param(autoplay is ture) , it still can't auto start.

help, thx~!

Play from a specific time-point

Hello!
First of all this is a great plugin! But I am wondering if its possible to start the player from a specific time point?

I want to load the plugin but when I refresh the page I can continue in the plugin where we left off.
I think this could be accomplished by an option like:

var option = { start: 0 // start time in seconds (or miliseconds) }

Is this possible? (maybe its already possible)
Thanks in advance!

APlayer volume not working on firefox.

I have the APlayer set up and running and it works great on google chrome browser but it fails to work on firefox. The volume button just drops to 0% and when you click it does not work.

Here is a .gif to show what its happening: the gif

Any help would be appreciated and thank you for this awesome player :)

preload issue

please add preload enable and disable on Aplayer
this function will useful for server load
thanks Admin for very very good Player

How to pause first player when second player start?

Hi,

I can't figure out how the first player can be paused if second, third or any other player starts playing.

Can you tell me with an example code? Demo page also doesn't stop any other player.

Thanks for your efforts. It's a great player indeed.

Hover color should be configurable

Say, if the webpage theme is white text on dark(light on dark), then it can cause style problem.
Example:
hover

Currently hover color is hard coded:

          &:hover {
               background: #efefef;
           }

So is the background color of current item being played.
I think it would be great to make it configurable as an option, the implementation would be rather simple.

歌词的小数位秒数为3位时,解析出错

for example:

[ti:告白日和、です ]
[ar:US]
[al:μ's Best Album Best Live collection]
[00:00.071]告白日和、です - 内田彩
[00:00.071]词:畑亜贵
[00:00.071]曲:若林充
[00:00.121]
[00:00.751]ねえひとつだけ聞いていい
[00:04.041]私のこと
[00:12.100]会えるかも今日は心が騒いで
[00:17.140]スキップしたくなった
[00:19.979]ときめきに踊る瞬間
[00:23.219]私のことなど[ti:告白日和、です ]

Songs with even number are automatically skipped

Songs with even number are automatically skipped in Safari but not in other browsers, FYI I'm using Safari 9.1 on OS X 10.11.4. Plus the progress bar's click zone is so narrow thus making it hardly clickable.

i want to use ajax to change option ,but it seems doesn't useful in this way

var option = {
element: document.getElementById('player1'),
narrow: false,
autoplay: true,
showlrc: false,
mutex: true,
theme: '#e6d0b2',
preload: 'metadata',
music: {
title: 'Preparation',
author: 'Hans Zimmer/Richard Harvey',
url: 'http://devtest.qiniudn.com/Preparation.mp3',
pic: 'http://devtest.qiniudn.com/Preparation.jpg'
}
};

var ap1 = new APlayer(option);
ap1.init;
//it's useful as i use the dome ,but i don't know where is the problem

Play music over diffrent tabs

I would love if anyone here could tell how I can make the music play over diffrent pages/tabs on the same domain, where I can just go to a diffrent sub-url and it will keep playing, sessionstorage perhaps? And how do I set default volume to 50%? Thanks

Load lyric in construct function

like

var ap = new APlayer({
    element: document.getElementById('player1'),
    narrow: false,
    autoplay: true,
    showlrc: false,
    theme: '#e6d0b2',
    music: {
        title: 'Preparation',
        author: 'Hans Zimmer/Richard Harvey',
        url: 'http://7xifn9.com1.z0.glb.clouddn.com/Preparation.mp3',
        pic: 'http://7xifn9.com1.z0.glb.clouddn.com/Preparation.jpg',
        lyric: '[00:00.00]first line\n[00:01.00]second line\n[00:02.00]third line\n'
    }
});
ap.init(); 

When the parameter don't have lyric, it can load lyric via 'aplayer-lrc-content'.

无法解析只精确到秒的歌词

[00:59]上路 巩州遇虎熊 (熊山君,寅将军)
[01:01]五百年前一场疯 腾宵又是孙悟空 (孙悟空)
[01:05]失马 鹰愁涧飞白龙 (白龙马)
[01:07]沙河阻断路难通 福陵山中收天蓬 (沙和尚,猪八戒)
[01:11]岭上 前行逆黄风 (黄风怪)
[01:14]七星不照波月洞 千年白骨化阴风 (奎木狼,白骨精)
[01:18]鱼篮 网通天一尾红 (灵感大王)
[01:20]紫金葫芦二道童 九尾老狐敢压龙 (金、银角大王,压龙大仙)
[01:24]白虹坠 雪浪击石碎
[01:27]思归 难归 堕回 轮回

代码中小背景图的样式错误会导致当前页面作为一个image被加载,服务器将会收到2次页面的请求。

            var l = '\n                <div class="aplayer-pic" ' + (this.music.pic ? 'style="background-image: url("' + encodeURI(this.music.pic) + '");"' : "") + '>\n                    <div class="aplayer-button aplayer-play">\n                        <i class="demo-icon aplayer-icon-play"></i>\n                    </div>\n                </div>\n                <div class="aplayer-info">\n                    <div class="aplayer-music">\n                        <span class="aplayer-title"></span>\n                        <span class="aplayer-author"></span>\n                    </div>\n                    <div class="aplayer-lrc">\n                        <div class="aplayer-lrc-contents" style="transform: translateY(0); -webkit-transform: translateY(0);"></div>\n                    </div>\n                    <div class="aplayer-controller">\n                        <div class="aplayer-bar-wrap">\n                            <div class="aplayer-bar">\n                                <div class="aplayer-loaded" style="width: 0"></div>\n                                <div class="aplayer-played" style="width: 0; background: ' + this.option.theme + ';">\n                                    <span class="aplayer-thumb" style="border: 1px solid ' + this.option.theme + ';"></span>\n                                </div>\n                            </div>\n                        </div>\n                        <div class="aplayer-time">\n                             - <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>\n                            <div class="aplayer-volume-wrap">\n                                <i class="demo-icon aplayer-icon-volume-down"></i>\n                                <div class="aplayer-volume-bar-wrap">\n                                    <div class="aplayer-volume-bar">\n                                        <div class="aplayer-volume" style="height: 80%; background: ' + this.option.theme + ';"></div>\n                                    </div>\n                                </div>\n                            </div>\n                            <i class="demo-icon aplayer-icon-loop' + (this.loop ? "" : " aplayer-noloop") + '"></i>' + (this.multiple ? '<i class="demo-icon aplayer-icon-menu"></i>' : "") + "\n                        </div>\n                    </div>\n                </div>";

这一句中的'style="background-image: url("' + encodeURI(this.music.pic) + '");"' 需改为'style="background-image: url(' + encodeURI(this.music.pic) + ');"' ,去掉前后两个",否则将导致页面将当前页作为一个image对象载入。

new fn setTrack();

Hello,

Will be great if you add new fn`s to interact with the playlist. For example at the moment i need fn to set manual which track to play.

Example:
I have playlist with 5 tracks and i need to listen track 3 from 45s.

ap.setTrack(3);
ap.play(45);

Thx.

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.