fix console

This commit is contained in:
SrGooglo 2023-08-27 14:45:46 +00:00
parent 7c1169093a
commit 0c4eb05d1c
2 changed files with 10 additions and 11 deletions

View File

@ -3,14 +3,13 @@ import { CapacitorMusicControls } from "capacitor-music-controls-plugin-v3"
export default class MediaSession {
initialize() {
CapacitorMusicControls.addListener("controlsNotification", (info) => {
this.console.log(info)
console.log(info)
this.handleControlsEvent(info)
})
// ANDROID (13, see bug above as to why it's necessary)
document.addEventListener("controlsNotification", (event) => {
this.console.log(event)
console.log(event)
const info = { message: event.message, position: 0 }

View File

@ -120,7 +120,7 @@ export default class Player extends Core {
app.cores.sync.music.dispatchEvent("music.player.state.update", this.state)
},
"player.seeked": (to) => {
app.cores.sync.music.dispatchEvent("music.player.seek", to)
app.cores.sync.music.dispatchEvent("music.player.seek", to)
},
}
@ -213,12 +213,12 @@ export default class Player extends Core {
return false
}
if (!app.layout.floatingStack) {
this.console.error("Floating stack not found")
if (!app.layout.tools_bar) {
this.console.error("Tools bar not found")
return false
}
this.currentDomWindow = app.layout.floatingStack.add("mediaPlayer", EmbbededMediaPlayer)
this.currentDomWindow = app.layout.tools_bar.attachRender("mediaPlayer", EmbbededMediaPlayer)
}
detachPlayerComponent() {
@ -227,12 +227,12 @@ export default class Player extends Core {
return false
}
if (!app.layout.floatingStack) {
this.console.error("Floating stack not found")
if (!app.layout.tools_bar) {
this.console.error("Tools bar not found")
return false
}
app.layout.floatingStack.remove("mediaPlayer")
app.layout.tools_bar.detachRender("mediaPlayer")
this.currentDomWindow = null
}
@ -266,7 +266,7 @@ export default class Player extends Core {
const img = new Image()
img.crossOrigin = "anonymous"
img.src = `https://cors-anywhere.herokuapp.com/${instance.manifest.cover ?? instance.manifest.thumbnail}`
img.src = instance.manifest.cover ?? instance.manifest.thumbnail //`https://cors-anywhere.herokuapp.com/${instance.manifest.cover ?? instance.manifest.thumbnail}`
const cover_analysis = await this.fac.getColorAsync(img)
.catch((err) => {