fix(app): stop other youtube embeds when one starts playing (#2642)

This commit is contained in:
Hampus authored and GitHub committed 2026-09-10 18:42:30 +02:00
1 parent 01fd11fea9
commit 5fea319f4e
2 files changed
+40 -6

No files matched your search

@@ -0,0 +1,27 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {makeAutoObservable} from 'mobx';
class ActiveIframeEmbed {
activeId: string | null = null;
constructor() {
makeAutoObservable(this, {}, {autoBind: true});
}
isActive(id: string): boolean {
return this.activeId === id;
}
claim(id: string): void {
this.activeId = id;
}
release(id: string): void {
if (this.activeId === id) {
this.activeId = null;
}
}
}
export default new ActiveIframeEmbed();