diff --git a/source/main.ts b/source/main.ts index 82f51e1..6681c1a 100644 --- a/source/main.ts +++ b/source/main.ts @@ -54,7 +54,9 @@ export default class Whisperer extends Plugin { this.addSettingTab(new WhispererSettingsTab(this.app, this)) this.registerEvent( - this.app.workspace.on('file-open', this.playerPerFile.handleFileOpen.bind(this)) + this.app.workspace.on('file-open', async (file) => { + await this.playerPerFile.handleFileOpen(file) + }) ) // Listen for file open const container = document.getElementsByClassName('obsidian-app')[0] diff --git a/source/player/player_per_global.ts b/source/player/player_per_global.ts index b8682ca..d4bba82 100644 --- a/source/player/player_per_global.ts +++ b/source/player/player_per_global.ts @@ -31,6 +31,7 @@ export default class PlayerPerGlobal { } else if (isAllowedHost(this.plugin.settings.vault_ambience_path, SC_HOSTS)) { playerFactory.createPlayer(player as HTMLElement, 'sc') } + } else { playerFactory.createPlayer(player as HTMLElement, 'local') }