mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 13:08:01 +02:00
Changes:
- Search continuations (related to #46) - Search for Playlists (related to #46)
This commit is contained in:
parent
7905394b26
commit
2ff1308278
6 changed files with 104 additions and 38 deletions
|
@ -97,11 +97,10 @@ async function Stream() {
|
|||
if (quality == 'best') sel = Math.max(...bandwidths);
|
||||
else if (quality == 'worst') sel = Math.min(...bandwidths);
|
||||
|
||||
if (sel) {
|
||||
if (sel)
|
||||
window.audioPlayer.selectVariantTrack(
|
||||
tracks[bandwidths.indexOf(sel)],
|
||||
);
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
|
@ -152,6 +151,30 @@ onMounted(() => {
|
|||
audio.value.pause();
|
||||
player.state.status = 'play';
|
||||
});
|
||||
|
||||
navigator.mediaSession.setActionHandler('previoustrack', () => {
|
||||
if (data.state.urls.length > 2) {
|
||||
const i = data.state.urls.map(s => s.url).indexOf(data.state.url);
|
||||
|
||||
data.getSong(data.state.urls[i - 1].url);
|
||||
}
|
||||
});
|
||||
|
||||
navigator.mediaSession.setActionHandler('nexttrack', () => {
|
||||
if (data.state.urls.length > 2) {
|
||||
const i = data.state.urls.map(s => s.url).indexOf(data.state.url);
|
||||
|
||||
data.getSong(data.state.urls[i + 1].url);
|
||||
}
|
||||
});
|
||||
|
||||
navigator.mediaSession.setActionHandler('seekbackward', () => {
|
||||
audio.value.duration -= 10;
|
||||
});
|
||||
|
||||
navigator.mediaSession.setActionHandler('seekforward', () => {
|
||||
audio.value.duration += 10;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue