diff --git a/README.md b/README.md index 93e71ef5..365bca56 100644 --- a/README.md +++ b/README.md @@ -1036,6 +1036,7 @@ click the `play` link next to an audio file, or copy the link target to [share i open the `[🎺]` media-player-settings tab to configure it, * "switches": + * `[🔁]` repeats one single song forever * `[🔀]` shuffles the files inside each folder * `[preload]` starts loading the next track when it's about to end, reduces the silence between songs * `[full]` does a full preload by downloading the entire next file; good for unreliable connections, bad for slow connections diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 891b8b52..16e4f538 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -271,6 +271,7 @@ var Ls = { "ml_eq": "audio equalizer", "ml_drc": "dynamic range compressor", + "mt_loop": "loop/repeat one song\">🔁", "mt_shuf": "shuffle the songs in each folder\">🔀", "mt_aplay": "autoplay if there is a song-ID in the link you clicked to access the server$N$Ndisabling this will also stop the page URL from being updated with song-IDs when playing music, to prevent autoplay if these settings are lost but the URL remains\">a▶", "mt_preload": "start loading the next song near the end for gapless playback\">preload", @@ -875,6 +876,7 @@ var Ls = { "ml_eq": "audio equalizer (tonejustering)", "ml_drc": "compressor (volum-utjevning)", + "mt_loop": "spill den samme sangen om og om igjen\">🔁", "mt_shuf": "sangene i hver mappe$Nspilles i tilfeldig rekkefølge\">🔀", "mt_aplay": "forsøk å starte avspilling hvis linken du klikket på for å åpne nettsiden inneholder en sang-ID$N$Nhvis denne deaktiveres så vil heller ikke nettside-URLen bli oppdatert med sang-ID'er når musikk spilles, i tilfelle innstillingene skulle gå tapt og nettsiden lastes på ny\">a▶", "mt_preload": "hent ned litt av neste sang i forkant,$Nslik at pausen i overgangen blir mindre\">forles", @@ -1479,6 +1481,7 @@ var Ls = { "ml_eq": "音频均衡器", "ml_drc": "动态范围压缩器", + "mt_loop": "循环播放当前的歌曲\">🔁", //m "mt_shuf": "在每个文件夹中随机播放歌曲\">🔀", "mt_aplay": "如果链接中有歌曲 ID,则自动播放,禁用此选项将停止在播放音乐时更新页面 URL 中的歌曲 ID,以防止在设置丢失但 URL 保留时自动播放\">自动播放▶", "mt_preload": "在歌曲快结束时开始加载下一首歌,以实现无缝播放\">预加载", @@ -2292,6 +2295,7 @@ var mpl = (function () { ebi('op_player').innerHTML = ( '

' + L.cl_opts + '

' + + ' 0.1) mp.au.currentTime = 0; @@ -4118,6 +4127,7 @@ function play(tid, is_ev, seek) { try { mp.nopause(); + mp.au.loop = mpl.loop; if (mpl.aplay || is_ev !== -1) mp.au.play(); @@ -4162,6 +4172,15 @@ function scroll2playing() { } +function evau_end(e) { + if (!mpl.loop) + return next_song(e); + ev(e); + mp.au.currentTime = 0; + mp.au.play(); +} + + // event from the audio object if something breaks function evau_error(e) { var err = '', diff --git a/scripts/tl.js b/scripts/tl.js index 4e52a077..b3c98a4d 100644 --- a/scripts/tl.js +++ b/scripts/tl.js @@ -357,6 +357,7 @@ var tl_browser = { "ml_eq": "audio equalizer", "ml_drc": "dynamic range compressor", + "mt_loop": "loop/repeat one song\">🔁", "mt_shuf": "shuffle the songs in each folder\">🔀", "mt_aplay": "autoplay if there is a song-ID in the link you clicked to access the server$N$Ndisabling this will also stop the page URL from being updated with song-IDs when playing music, to prevent autoplay if these settings are lost but the URL remains\">a▶", "mt_preload": "start loading the next song near the end for gapless playback\">preload", @@ -402,6 +403,7 @@ var tl_browser = { "mm_eunk": "Unknown Errol", "mm_e404": "Could not play audio; error 404: File not found.", "mm_e403": "Could not play audio; error 403: Access denied.\n\nTry pressing F5 to reload, maybe you got logged out", + "mm_e500": "Could not play audio; error 500: Check server logs.", "mm_e5xx": "Could not play audio; server error ", "mm_nof": "not finding any more audio files nearby", "mm_prescan": "Looking for music to play next...",