Commit Graph

167 Commits

Author SHA1 Message Date
DIYgod ec0c5c3c05
smooth volume bar 2018-03-08 22:58:45 +08:00
DIYgod 21ca7d7b9a
fix muted volume value 2018-03-08 22:46:38 +08:00
DIYgod f4ffe98bf6
set loop one to loop all if single music 2018-03-08 22:46:05 +08:00
DIYgod dedc1bf62d
scalable thumb 2018-03-08 22:44:35 +08:00
DIYgod a31d911948
support lyric without \n 2018-03-08 22:07:22 +08:00
DIYgod 44ff1c8ff7
support lyric in enhanced format 2018-03-08 18:25:53 +08:00
DIYgod 7b9074ffd0
support lyric in `[mm:ss]` format 2018-03-08 18:21:10 +08:00
DIYgod fb4211a0b0
fix playedPromise overwrited in play 2018-03-08 17:19:23 +08:00
DIYgod cf5972879a
better better handling play promise 2018-03-08 11:55:51 +08:00
DIYgod 75b86a6beb
auto add class aplayer 2018-03-08 00:52:42 +08:00
DIYgod 5cbc875993
lighter shadow 2018-03-08 00:52:21 +08:00
DIYgod f29066f1b6
showlrc -> lrc 2018-03-08 00:35:14 +08:00
DIYgod 021df59e85
new option: listFolded; listmaxheight -> listMaxHeight 2018-03-08 00:34:01 +08:00
DIYgod 6029ce980c
mode -> loop and order 2018-03-08 00:02:07 +08:00
DIYgod e2e8884a45
better handling play promise 2018-03-06 16:23:55 +08:00
DIYgod c590dd4080
move getRandomOrder to utils 2018-03-02 16:12:55 +08:00
DIYgod 532dddc3b0
clear up and rename some api 2018-03-02 15:43:02 +08:00
DIYgod b387833730
events module 2018-03-02 11:27:44 +08:00
DIYgod c9e7f8aa11
time module; some optimize 2018-03-02 01:50:53 +08:00
DIYgod 5905d0ed29
controller module 2018-03-01 19:01:41 +08:00
DIYgod cd21726da9
lrc module 2018-03-01 18:09:07 +08:00
DIYgod 3c594ebb71
new modules: bar icons options player template utils user 2018-02-09 19:04:47 +08:00
DIYgod 4d1cdb3341
better workflow 2018-01-12 11:53:25 +08:00
Michael 81002c0bf9 Removed check for hidden list, allows add music animation 2017-12-20 22:14:16 -05:00
Michael e3ce22bf7d Rounded up list.style.height to 33px 2017-12-20 08:03:01 -05:00
Michael 9d772ef052 Add music fix 2017-12-19 21:29:00 -05:00
Michael 77cc9d9528 Small comment change 2017-12-18 01:33:41 -05:00
Michael 88aff9111b Fixed Indenting and added changes from @DIYgod 2017-12-18 01:20:29 -05:00
Michael 82ca11d126 New remove song function 2017-12-15 15:03:52 -05:00
Eric Robinson 1a4ea7a4ed Change variables to constants for invariant values
Use const instead of let to help signify that the initialized values are not expected to change. This commit resolves some review requests on APlayer PR #175.
2017-12-14 11:04:08 -05:00
Eric Robinson 8a1f19ec57 Duplicate pause event logic into the abort event
It appears that the "pause" event is never triggered if you call `audio.pause()` on a playing audio element and then immediately set `audio.src`. The "abort" event, however, _is_ called in this case.

Because the "pause" event isn't raised, the APlayer code that resets the pause button state doesn't trigger. This leaves the APlayer in a state where the pause button is still showing but the audio element _isn't_ actually playing. Because `APlayer.toggle()` (which is called by the Play/Pause button) does not check the state of the audio element, and instead checks the state of the UI, we end up in a situation where the pause button is visible but we're not playing. The call to Toggle, then, calls `APlayer.pause()` which checks to see if it's already paused or not. Because the audio element is already paused, the call is ignored and the event never triggers (which would reset the button UI).

This [temporary] "fix" resolves the issue by intercepting the "abort" event that is triggered when the "pause" event is aborted. It then runs the same logic as the "pause" event, checking to see if the playback button is in a "paused" state and, if so, resetting it to a "play" button state.

_In theory_, the checks at the beginning of the `pauseHandler` arrow function should be enough to safeguard any other unrelated calls to "abort".
2017-12-12 16:38:41 -05:00
Eric Robinson e7168ec462 Actually set the music to the audio element
In the default state, each audio element should already have the music url set. However, if a user externally adjusts the music stored on the APlayer and attempts to switch to it, everything _but_ the audio would change. This allows users to modify the music set in the options manually.
2017-12-12 13:42:54 -05:00
Eric Robinson 17c80e4083 Do not autoplay in mobile in `setMusic`
This change appears to have been made to support playlist auto-advance in mobile. This was a workaround to handle the autoplay guard lower in the function which was removed in an earlier commit on this branch. The play call is now handled external to the `setMusic` call, which allows external logic to determine whether play should be called on mobile or not.
2017-12-12 13:40:39 -05:00
Eric Robinson fa66dd90f4 Ensure that automatic playlist advance works
When playlists advance, the music should continue to play. The recent change to stop `setMusic` from "autoplaying" in this case must now be handled directly by the caller. This is far more clear to read: "set next music and play it."
2017-12-12 13:37:31 -05:00
Eric Robinson bd4426ff2b Remove redundant check
The constructor ensures that autoplay is false for mobile devices at this point.
2017-12-12 13:11:12 -05:00
Eric Robinson c0e868484a Move the autoplay check into the constructor
The `autoplay` option only makes sense in the constructor. After that, callers of `setMusic` should determine whether or not to begin playback based on their own state.
2017-12-12 13:09:35 -05:00
Eric Robinson db6e0f8b84 Verify actual state rather than flag
No need to track against a separate (and possibly out-of-sync) flag when it is just as easy to check the actual state of the loaded music.
2017-12-12 12:35:26 -05:00
Eric Robinson 00bec0c66e Remove unnecessary branches in code
Modulo operators are perfect for this type of logic.
2017-12-12 11:55:39 -05:00
Michael 77d00898be Fixes no author showing bug 2017-11-23 16:55:42 -05:00
gkiwi 00aac89320 Merge branch 'master' of github.com:bugkiwi/APlayer 2017-11-14 19:07:21 +08:00
gkiwi 1fd103c326 修复aplayer-list listmaxheight判断 语法错误问题
Change-Id: I90d1fab602500bcffdac82cb3b19a9b37e636de8
2017-11-14 19:02:17 +08:00
DIYgod f6fdb2a49d
Merge pull request #162 from kn007/patch-1
fix pic 重复打印,拉伸输出
2017-11-01 21:35:59 -05:00
Karl Chen 665b0e7342
Update APlayer.scss 2017-10-31 23:00:16 +08:00
Karl Chen ceb2bc5feb
Update APlayer.js 2017-10-31 12:10:36 +08:00
DIYgod dedcfbf1ac
switch to next song in mobile, close #138 2017-06-08 00:16:56 +08:00
Tommy Nguyen 9a99a327e3 Wrap getSVG calls in template literal syntax 2017-03-31 11:56:06 -04:00
DIYgod cbc0f99eee new api: destroy, addMusic 2017-03-26 23:31:22 +08:00
DIYgod d381582fe4
prevent buttons from submitting forms 2017-02-09 11:22:58 +08:00
DIYgod 53096c4e0b
unify `ap.play()` with `ap.audio.play()`, close #98 2016-12-22 00:14:12 +08:00
DIYgod c4c3ead825
fix NaN before canplay, close #94 2016-12-21 18:48:02 +08:00
DIYgod a0467709eb
Fix lrc background, close #100 2016-12-01 09:56:20 +08:00
DIYgod 3877378602
fix switching music bug, close #83 #85 2016-10-26 21:17:31 +08:00
DIYgod 0b0be17c70
bind play() pause() function to play pause event 2016-10-24 10:37:36 +08:00
DIYgod 96190c0ebf
better single icon 2016-10-18 18:31:58 +08:00
DIYgod e78ac91628
fix CSS confliction in button 2016-10-17 10:20:24 +08:00
DIYgod 9030303ad1
update devDependencies 2016-10-17 10:00:10 +08:00
DIYgod 097fd27caa
update console version 2016-10-14 10:36:02 +08:00
DIYgod 5ce630df04
Optimize sorting algorithm for random mode, fix: #77 2016-10-14 10:26:50 +08:00
DIYgod c1c83d3c96
optimize the style of aplayer with lrc 2016-10-11 11:24:03 +08:00
DIYgod 89992c84c9
fix aplayer-bar width 2016-10-11 10:02:15 +08:00
Argenis Villasmil 02058ad17f display hh:mm:ss format when audio is over an hour long 2016-10-10 21:01:30 -04:00
DIYgod d7365d9546
Make music title and lrc selectable; click list to play next song in mobile: close #69 2016-09-30 11:13:35 +08:00
DIYgod 1386beaa27
Fix UMD bug 2016-09-26 01:50:13 +08:00
DIYgod 62d146a9dc
Scrollbar style, close #72 2016-09-20 12:12:21 +08:00
DIYgod fa0017c55d
random mode: from first music; play list: click to jump 2016-09-19 11:38:24 +08:00
DIYgod 9459d76b4b
New option: mode, listmaxhight 2016-09-19 10:34:12 +08:00
DIYgod f7e91c04d3
fix bug in `showlrc: 2` 2016-09-09 01:46:23 +08:00
DIYgod 4621a74691
fix getting lrc repeatedly 2016-08-28 00:20:50 +08:00
DIYgod f91eba1aba
New showlrc type: 3, get lrc from lrc file or API 2016-08-28 00:12:38 +08:00
DIYgod 210a9bbec0
Add console; Remove init function; Simplify this space; Update dev dependencies 2016-08-27 18:17:49 +08:00
DIYgod a1948749cd
build with webpack 2016-07-11 21:13:39 +08:00
DIYgod d2b673db39
fix long list title display error 2016-07-11 11:22:15 +08:00
DIYgod d116c75a09
improve UI; new API: toggle 2016-07-11 10:16:53 +08:00
DIYgod a5cc501f3b
font -> inline svg 2016-07-08 16:15:22 +08:00
DIYgod 9f9ded6e1e
API: play volume; Bug: encodeURI image link 2016-07-08 11:25:34 +08:00
DIYgod 12fc04957d
new option: preload 2016-06-13 14:23:51 +08:00
DIYgod c5776b2a78
fix bugs in HTML 2016-06-13 14:06:27 +08:00
DIYgod 7b8ad10c04
Fix bug: multiple ended event in iOS; clicking list error in mobile 2016-05-14 22:37:48 +08:00
DIYgod 47270238cb
Fix bug: Symbol is not defined 2016-05-14 21:40:03 +08:00
DIYgod 04e950b1eb
bugs with mutex 2016-05-14 20:04:41 +08:00
DIYgod f1bc748330
optimize 2016-05-10 01:00:16 +08:00
DIYgod 40d95344fd
fix drag bug, new option: loop 2016-05-05 20:57:30 +08:00
Micooz 5206eed8e5 deprecate vars outside class 2016-05-01 21:27:17 +08:00
Micooz 82b7f777f6 remove redundant semicolon 2016-05-01 21:00:29 +08:00
DIYgod 12ef281547
event binding 2016-04-28 17:22:06 +08:00
DIYgod 2af86eca50
README: npm --save 2016-04-22 18:05:51 +08:00
DIYgod 16330ca044 lrc in js 2016-04-04 02:06:11 +08:00
DIYgod e2ae50d956 more ES6 2016-03-30 00:29:20 +08:00
DIYgod ccfb471d24 style of aplayer-time-narrow 2016-03-28 01:29:40 +08:00
DIYgod b626991dcb fix the width of aplayer bar, improve loading process 2016-03-28 01:04:28 +08:00
DIYgod 1014ed45cd Fix box-sizing conflict 2016-03-28 00:28:17 +08:00
DIYgod f013a39d64 add option mutex (pause other players when started) 2016-03-27 23:59:59 +08:00
DIYgod d34525e4d1 ES6 and sourcemaps 2016-03-27 04:19:03 +08:00
DIYgod 58df0cd151 improve mobile compatibility: Can't set currentTime before loadedmetadata 2016-01-19 00:43:47 +08:00
DIYgod d50f90380b fix global variables pollution 2016-01-17 13:49:51 +08:00
DIYgod a77b723c6e add play button's animation, fix loop bug 2016-01-16 21:06:04 +08:00
DIYgod 86b0dc3d05 add exports and fix the entry point of the module 2016-01-16 14:48:02 +08:00
DIYgod 0a77bbca3b mobile compatibility of playlist 2016-01-15 15:09:40 +08:00
DIYgod d565c402ea support playlist 2016-01-14 23:22:49 +08:00
DIYgod 90ef8b0456 fix webkitTransform 2016-01-05 01:41:25 +08:00