diff --git a/src/ext/UWContent.ts b/src/ext/UWContent.ts index dc8e34c..766e9ec 100644 --- a/src/ext/UWContent.ts +++ b/src/ext/UWContent.ts @@ -135,7 +135,7 @@ export default class UWContent { if (this.actionHandler) { this.actionHandler.destroy(); } - this.actionHandler = new ActionHandler(this.pageInfo); + this.actionHandler = new ActionHandler(this.pageInfo.eventBus, this.settings, this.logger); this.actionHandler.init(); this.logger.log('info', 'debug', "[uw.js::setup] ActionHandler initiated."); diff --git a/src/ext/lib/video-data/PageInfo.ts b/src/ext/lib/video-data/PageInfo.ts index 904e8ac..abb9bc7 100644 --- a/src/ext/lib/video-data/PageInfo.ts +++ b/src/ext/lib/video-data/PageInfo.ts @@ -7,6 +7,7 @@ import Logger from '../Logger'; import Settings from '../Settings'; import ExtensionMode from '../../../common/enums/ExtensionMode.enum'; import CommsClient from '../comms/CommsClient'; +import EventBus from '../EventBus'; if (process.env.CHANNEL !== 'stable'){ console.info("Loading PageInfo"); @@ -51,6 +52,7 @@ class PageInfo { logger: Logger; settings: Settings; comms: CommsClient; + eventBus: EventBus; videos: {videoData: VideoData, element: HTMLVideoElement}[] = []; //#endregion @@ -73,6 +75,8 @@ class PageInfo { this.extensionMode = extensionMode; this.readOnly = readOnly; + this.eventBus = new EventBus(); + if (comms){ this.comms = comms; } diff --git a/src/ext/lib/video-data/VideoData.ts b/src/ext/lib/video-data/VideoData.ts index cb7ff8f..c99f11a 100644 --- a/src/ext/lib/video-data/VideoData.ts +++ b/src/ext/lib/video-data/VideoData.ts @@ -90,6 +90,10 @@ class VideoData { this.eventBus = new EventBus(); + if (pageInfo.eventBus) { + this.eventBus.setUpstreamBus(pageInfo.eventBus); + } + this.setupStageOne(); }