mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix(app): stop other youtube embeds when one starts playing (#2642)
This commit is contained in:
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();
|
||||
Reference in new issue
Block a user