Commit Graph

247 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 e2f2888ea5
update devDependencies 2018-02-09 14:30:56 +08:00
DIYgod 2287758344
update README 2018-02-07 16:39:46 +08:00
DIYgod a2f96199fe
add OpenCollective 2018-01-12 14:07:26 +08:00
DIYgod 2df2cb49a6
rm codesponsor 2018-01-12 12:03:05 +08:00
DIYgod 1ef9d47b80
update Related Projects 2018-01-12 11:59:58 +08:00
DIYgod 4d1cdb3341
better workflow 2018-01-12 11:53:25 +08:00
DIYgod 29a462487c
Merge pull request #178 from MPierre9/add-music-fix
Add Music Fix, resolves issue #177
2017-12-21 11:21:33 +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
DIYgod b654f6c6af
Merge pull request #176 from MPierre9/remove-song
Adds Remove Song Functionality
2017-12-19 23:50:08 +08: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
DIYgod fa59380e4a
Merge pull request #175 from ericdrobinson/fix-setmusic-broken-pause
Fix broken pause state when calling setMusic on playing audio element
2017-12-15 10:18:46 +08:00
Eric Robinson e22933a503 Update to source map for previous commit changes
No changes to the built minified JS, but slight changes to the source map (let-to-const didn't result in meaningful changes in exported JS).
2017-12-14 11:06:45 -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 80b84affdc Built versions of the library
Add the built version of APlayer that contains fixes from this branch.
2017-12-12 16:39:49 -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 a5c2c58092
Merge pull request #2 from ericdrobinson/fix-autoplay
Fix autoplay
2017-12-12 14:09:33 -05:00
Eric Robinson 27c8f6b44c Add build results to the repo
Work is effectively done on the branch so add the built versions.
2017-12-12 14:00:35 -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 ea7a97af3f
Merge pull request #1 from ericdrobinson/simple-fixes
Simple fixes
2017-12-12 12:47:55 -05:00
Eric Robinson a6705d08b1 Build output for simple fix changes
Built files that incorporate changes from this branch.
2017-12-12 12:41:34 -05:00