start integrating websocket, player basically done

This commit is contained in:
2024-06-27 16:50:03 +02:00
parent 76f543eb2f
commit 1e11f1dc2e
13 changed files with 567 additions and 48 deletions

View File

@@ -228,6 +228,7 @@ class MusicKitJSWrapper {
switch ( action ) {
case "play":
if ( this.isPreparedToPlay ) {
this.control( 'pause' );
if ( this.playlist[ this.playingSongID ].origin === 'apple-music' ) {
this.musicKit.play();
return false;
@@ -285,6 +286,7 @@ class MusicKitJSWrapper {
return false;
}
case "next":
this.control( 'pause' );
if ( this.queuePos < this.queue.length - 1 ) {
this.queuePos += 1;
this.prepare( this.queue[ this.queuePos ] );
@@ -300,6 +302,7 @@ class MusicKitJSWrapper {
return true;
}
case "previous":
this.control( 'pause' );
if ( this.queuePos > 0 ) {
this.queuePos -= 1;
this.prepare( this.queue[ this.queuePos ] );