mirror of
https://github.com/janishutz/MusicPlayerV2.git
synced 2025-11-25 04:54:23 +00:00
a bit of progress on the player
This commit is contained in:
@@ -6,7 +6,8 @@ createApp( {
|
|||||||
return {
|
return {
|
||||||
hasLoaded: false,
|
hasLoaded: false,
|
||||||
songs: {},
|
songs: {},
|
||||||
playingSong: {}
|
playingSong: {},
|
||||||
|
isPlaying: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -181,6 +181,29 @@ export default {
|
|||||||
}
|
}
|
||||||
}, 300 );
|
}, 300 );
|
||||||
},
|
},
|
||||||
|
sendUpdate( update ) {
|
||||||
|
let data = {};
|
||||||
|
if ( update === 'pos' ) {
|
||||||
|
data = this.playbackPos;
|
||||||
|
} else if ( update === 'playingSong' ) {
|
||||||
|
data = this.playingSong;
|
||||||
|
} else if ( update === 'songQueue' ) {
|
||||||
|
data = this.playbackPos;
|
||||||
|
} else if ( update === 'pos' ) {
|
||||||
|
data = this.playbackPos;
|
||||||
|
}
|
||||||
|
let fetchOptions = {
|
||||||
|
method: 'post',
|
||||||
|
body: JSON.stringify( { 'type': update, 'data': data } ),
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'charset': 'utf-8'
|
||||||
|
},
|
||||||
|
};
|
||||||
|
fetch( '/statusUpdate', fetchOptions ).then( res => {
|
||||||
|
|
||||||
|
} );
|
||||||
|
},
|
||||||
control( action ) {
|
control( action ) {
|
||||||
// https://css-tricks.com/lets-create-a-custom-audio-player/
|
// https://css-tricks.com/lets-create-a-custom-audio-player/
|
||||||
let musicPlayer = document.getElementById( 'music-player' );
|
let musicPlayer = document.getElementById( 'music-player' );
|
||||||
|
|||||||
Reference in New Issue
Block a user