+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/client/appleMusic/index.js b/frontend/src/client/appleMusic/index.js
new file mode 100644
index 0000000..6cbf3b5
--- /dev/null
+++ b/frontend/src/client/appleMusic/index.js
@@ -0,0 +1,47 @@
+const app = Vue.createApp( {
+ data() {
+ return {
+ musicKit: null,
+ isLoggedIn: false,
+ }
+ },
+ methods: {
+ logInto() {
+ if ( !this.musicKit.isAuthorized ) {
+ this.musicKit.authorize().then( () => {
+ this.musicKit.play();
+ this.isLoggedIn();
+ } );
+ }
+ },
+ initMusicKit () {
+ fetch( '/getAppleMusicDevToken' ).then( res => {
+ if ( res.status === 200 ) {
+ res.text().then( token => {
+ // MusicKit global is now defined
+ MusicKit.configure( {
+ developerToken: token,
+ app: {
+ name: 'MusicPlayer',
+ build: '2'
+ }
+ } );
+ this.musicKit = MusicKit.getInstance();
+ if ( this.musicKit.isAuthorized ) {
+ this.isLoggedIn = true;
+ }
+ } );
+ }
+ } );
+ }
+ },
+ created() {
+ if ( !window.MusicKit ) {
+ document.addEventListener( 'musickitloaded', () => {
+ self.initMusicKit();
+ } );
+ } else {
+ this.initMusicKit();
+ }
+ },
+} ).mount( '#app' );
\ No newline at end of file
diff --git a/frontend/public/musickit.js b/frontend/src/client/appleMusic/musickit.js
similarity index 100%
rename from frontend/public/musickit.js
rename to frontend/src/client/appleMusic/musickit.js
diff --git a/frontend/src/client/appleMusic/style.css b/frontend/src/client/appleMusic/style.css
new file mode 100644
index 0000000..64abd8c
--- /dev/null
+++ b/frontend/src/client/appleMusic/style.css
@@ -0,0 +1,16 @@
+/*
+* MusicPlayerV2 - style.css
+*
+* Created by Janis Hutz 11/14/2023, Licensed under the GPL V3 License
+* https://janishutz.com, development@janishutz.com
+*
+*
+*/
+
+body, html {
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ font-family: sans-serif;
+}
\ No newline at end of file
diff --git a/frontend/src/components/appleMusic.vue b/frontend/src/components/appleMusic.vue
deleted file mode 100644
index 46cfd8f..0000000
--- a/frontend/src/components/appleMusic.vue
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
AppleMusic
-
-
-
-
\ No newline at end of file
diff --git a/frontend/src/components/mediaPool.vue b/frontend/src/components/mediaPool.vue
index 38c12f3..6030e81 100644
--- a/frontend/src/components/mediaPool.vue
+++ b/frontend/src/components/mediaPool.vue
@@ -29,6 +29,7 @@
No songs loaded
+
@@ -379,6 +380,9 @@
this.update( { 'type': 'playback', 'status': false } );
this.$emit( 'com', { 'type': 'pause', 'song': song } );
},
+ useAppleMusic() {
+ fetch( 'http://localhost:8081/useAppleMusic' );
+ }
}
}
\ No newline at end of file
diff --git a/frontend/src/views/HomeView.vue b/frontend/src/views/HomeView.vue
index d36befc..a943e83 100644
--- a/frontend/src/views/HomeView.vue
+++ b/frontend/src/views/HomeView.vue
@@ -1,5 +1,5 @@
-
+
@@ -10,9 +10,6 @@
{ handleCom( info ) }" ref="pool">