Migrate to EventBus

This commit is contained in:
redphx
2024-12-08 21:06:42 +07:00
parent e1ba2344b7
commit b11d465804
10 changed files with 77 additions and 73 deletions

View File

@@ -1,5 +1,4 @@
import { AppInterface, STATES } from "@utils/global";
import { BxEvent } from "@utils/bx-event";
import { StreamSettings } from "@/utils/stream-settings";
import { BxEventBus } from "@/utils/bx-event-bus";
@@ -38,8 +37,8 @@ export class DeviceVibrationManager {
constructor() {
this.boundOnMessage = this.onMessage.bind(this);
window.addEventListener(BxEvent.DATA_CHANNEL_CREATED, e => {
const dataChannel = (e as any).dataChannel as RTCDataChannel;
BxEventBus.Stream.on('dataChannelCreated', payload => {
const { dataChannel } = payload;
if (dataChannel?.label === 'input') {
this.reset();