mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 13:08:01 +02:00
parent
212a0e6dd6
commit
b023b67e04
10 changed files with 502 additions and 325 deletions
|
@ -10,7 +10,8 @@ import { useAlert } from '@/stores/misc';
|
|||
|
||||
const player = usePlayer(),
|
||||
data = useData(),
|
||||
store = useStore();
|
||||
store = useStore(),
|
||||
a = useAlert();
|
||||
|
||||
const audio = ref(null);
|
||||
|
||||
|
@ -61,7 +62,7 @@ async function Stream() {
|
|||
window.offline = new shaka.offline.Storage(audioPlayer);
|
||||
window.offline.configure({
|
||||
offline: {
|
||||
progressCallback: (data, prog) => console.log(data, prog),
|
||||
progressCallback: ({ appMetadata: { title, artist } }, prog) => a.add(`${title} by ${artist}: ${Math.floor(prog*100)}%`),
|
||||
trackSelectionCallback: tracks => [
|
||||
tracks
|
||||
.sort((a, b) => a.bandwidth - b.bandwidth)
|
||||
|
@ -112,7 +113,7 @@ async function Stream() {
|
|||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
useAlert.add('error: ' + e.code);
|
||||
a.add('Error: ' + err.code);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue