@eka-care/ekascribe-ts-sdk 1.5.80 → 1.5.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,6 +4,7 @@ import pushFileToS3 from '../aws-services/upload-file-to-s3';
|
|
|
4
4
|
import { AUDIO_EXTENSION_TYPE_MAP, OUTPUT_FORMAT } from '../constants/constant';
|
|
5
5
|
import { CALLBACK_TYPE, SHARED_WORKER_ACTION } from '../constants/enums';
|
|
6
6
|
import { GET_S3_BUCKET_NAME } from '../fetch-client/helper';
|
|
7
|
+
import { SHARED_WORKER_CODE } from '../shared-worker/worker-code.generated';
|
|
7
8
|
import EkaScribeStore from '../store/store';
|
|
8
9
|
import compressAudioToMp3 from '../utils/compress-mp3-audio';
|
|
9
10
|
class AudioFileManager {
|
|
@@ -133,8 +134,10 @@ class AudioFileManager {
|
|
|
133
134
|
}
|
|
134
135
|
createSharedWorkerInstance() {
|
|
135
136
|
try {
|
|
136
|
-
//
|
|
137
|
-
const
|
|
137
|
+
// Create a Blob URL from the inline worker code to avoid cross-origin issues
|
|
138
|
+
const blob = new Blob([SHARED_WORKER_CODE], { type: 'application/javascript' });
|
|
139
|
+
const workerUrl = URL.createObjectURL(blob);
|
|
140
|
+
const worker = new SharedWorker(workerUrl);
|
|
138
141
|
this.sharedWorkerInstance = worker;
|
|
139
142
|
const onEventCallback = EkaScribeStore.eventCallback;
|
|
140
143
|
this.sharedWorkerInstance.port.onmessage = async (event) => {
|