Fixed sonos playback and add android background playback

This commit is contained in:
kontiko 2024-06-30 00:00:13 +02:00
parent 207b7f290f
commit f36df9e67b
13 changed files with 1814 additions and 1415 deletions

View file

@ -120,14 +120,17 @@ class SocketAuthority {
socket.on('dlna_play', () => this.Server.DLNAManager.continue_session(socket.id))
socket.on('dlna_pause', () => this.Server.DLNAManager.pause_session(socket.id))
socket.on('dlna_seek', (time) => this.Server.DLNAManager.seek(socket.id, time))
socket.on('dlna_set_volume', (volume) => this.Server.DLNAManager.setVolume(socket.id, volume))
// Logs
socket.on('set_log_listener', (level) => Logger.addSocketListener(socket, level))
socket.on('remove_log_listener', () => Logger.removeSocketListener(socket.id))
// Sent automatically from socket.io clients
socket.on('disconnect', (reason) => {
//Stop playback when socket is closed
Logger.removeSocketListener(socket.id)
this.Server.DLNAManager.exit_session(socket.id)
const _client = this.clients[socket.id]
if (!_client) {
Logger.warn(`[SocketAuthority] Socket ${socket.id} disconnect, no client (Reason: ${reason})`)