mirror of
https://github.com/janishutz/MusicPlayerV2.git
synced 2025-11-25 21:14:22 +00:00
start integrating websocket, player basically done
This commit is contained in:
@@ -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 ] );
|
||||
|
||||
Reference in New Issue
Block a user