some progress on player + playlist loading

This commit is contained in:
2024-06-25 11:45:11 +02:00
parent 56a714ab9e
commit 1ffdc873a7
10 changed files with 468 additions and 58 deletions

View File

@@ -29,7 +29,7 @@
import { ref } from 'vue';
import playlistView from '@/components/playlistView.vue';
import MusicKitJSWrapper from '@/scripts/player';
import MusicKitJSWrapper from '@/scripts/music-player';
const isPlaying = ref( false );
const repeatMode = ref( '' );
@@ -46,9 +46,9 @@
isPlaying.value = !isPlaying.value;
// TODO: Execute function on player
if ( isPlaying.value ) {
player.play();
player.control( 'play' );
} else {
player.pause();
player.control( 'pause' );
}
}
@@ -85,8 +85,28 @@
}
}
const getPlaylists = ( cb: ( data: object ) => void ) => {
player.getUserPlaylists( cb );
}
const logIntoAppleMusic = () => {
player.logIn();
}
const getAuth = (): boolean[] => {
return player.getAuth();
}
const skipLogin = () => {
player.init();
}
defineExpose( {
logIntoAppleMusic,
getPlaylists,
controlUI,
getAuth,
skipLogin,
} );
</script>