Compare commits

...

3 Commits

Author SHA1 Message Date
ce1707eb80 apply patch to mediaelement-plugins playlist 2024-11-11 03:15:12 +01:00
14f2cf536f add test using eslint 2024-11-11 03:14:48 +01:00
c8b75a7f3f mark as module 2024-11-11 02:39:04 +01:00
3 changed files with 21 additions and 3 deletions

View File

@ -1,6 +1,9 @@
.PHONY: all src css .PHONY: all depend css src
all: css src all: depend css src
depend:
patch -d mediaelement-plugins -p1 < patches/mediaelement-plugins/01-playlist.js.diff
css: css:
css/build.sh css/build.sh

View File

@ -1,10 +1,11 @@
{ {
"name": "myplayer", "name": "myplayer",
"version": "1.0.0", "version": "1.0.0",
"type": "module",
"description": "A Web-MP3-Player with Playlist Support", "description": "A Web-MP3-Player with Playlist Support",
"main": "src/player.js", "main": "src/player.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "npx eslint src/player.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -13,6 +14,7 @@
"author": "tilt <tilt@linuxfoo.de>", "author": "tilt <tilt@linuxfoo.de>",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"eslint": "^9.14.0",
"minify": "^11.4.1" "minify": "^11.4.1"
} }
} }

View File

@ -0,0 +1,13 @@
diff --git a/src/playlist/playlist.js b/src/playlist/playlist.js
index 82112fb..fcf4ade 100644
--- a/src/playlist/playlist.js
+++ b/src/playlist/playlist.js
@@ -81,7 +81,7 @@ Object.assign(MediaElementPlayer.prototype, {
player.endedCallback = () => {
if (player.currentPlaylistItem < player.listItems.length) {
- player.setSrc(player.playlist[++player.currentPlaylistItem]);
+ player.setSrc(player.playlist[++player.currentPlaylistItem].src);
player.load();
setTimeout(() => {
player.play();