Skip to content

Commit

Permalink
transmuxer: Migrate to webworkify-webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
xqq committed Jul 17, 2021
1 parent a739317 commit a41efd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/transmuxer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import EventEmitter from 'events';
import work from 'webworkify-webpack';
import Log from '../utils/logger.js';
import LoggingControl from '../utils/logging-control.js';
import TransmuxingController from './transmuxing-controller.js';
Expand All @@ -32,8 +33,7 @@ class Transmuxer {

if (config.enableWorker && typeof (Worker) !== 'undefined') {
try {
let work = require('webworkify');
this._worker = work(TransmuxingWorker);
this._worker = work(require.resolve('./transmuxing-worker'));
this._workerDestroying = false;
this._worker.addEventListener('message', this._onWorkerMessage.bind(this));
this._worker.postMessage({cmd: 'init', param: [mediaDataSource, config]});
Expand Down

0 comments on commit a41efd7

Please sign in to comment.