Skip to content

Commit

Permalink
Merge pull request #1585 from canalplus/fix/globalScope-onmessageerror
Browse files Browse the repository at this point in the history
MULTI_THREAD: Fix onmessageerror being undefined
  • Loading branch information
Florent-Bouisset authored Oct 23, 2024
2 parents 126d080 + 9d6b5ce commit d5d1787
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/main/worker/worker_main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type { IPlayerError, ITrackType } from "../../../public_types";
import createDashPipelines from "../../../transports/dash";
import arrayFind from "../../../utils/array_find";
import assert, { assertUnreachable } from "../../../utils/assert";
import globalScope from "../../../utils/global_scope";
import type { ILogFormat, ILoggerLevel } from "../../../utils/logger";
import { scaleTimestamp } from "../../../utils/monotonic_timestamp";
import objectAssign from "../../../utils/object_assign";
Expand Down Expand Up @@ -80,7 +81,7 @@ export default function initializeWorkerMain() {
*/
let playbackObservationRef: SharedReference<IWorkerPlaybackObservation> | null = null;

onmessageerror = (_msg: MessageEvent) => {
globalScope.onmessageerror = (_msg: MessageEvent) => {
log.error("MTCI: Error when receiving message from main thread.");
};
onmessage = function (e: MessageEvent<IMainThreadMessage>) {
Expand Down

0 comments on commit d5d1787

Please sign in to comment.