symposium 0.13.8 → 0.13.9
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.
- package/Symposium.js +6 -6
- package/package.json +1 -1
package/Symposium.js
CHANGED
|
@@ -85,17 +85,17 @@ export default class Symposium {
|
|
|
85
85
|
let file;
|
|
86
86
|
switch (audio.type) {
|
|
87
87
|
case 'url':
|
|
88
|
-
if (!audio.
|
|
88
|
+
if (!audio.data)
|
|
89
89
|
throw new Error('Audio URL is required');
|
|
90
90
|
|
|
91
|
-
if (audio.
|
|
91
|
+
if (audio.data.startsWith('/')) { // Local path
|
|
92
92
|
// Get with fs
|
|
93
|
-
if (!fs.existsSync(audio.
|
|
94
|
-
throw new Error('Audio file does not exist at the specified path: ' + audio.
|
|
93
|
+
if (!fs.existsSync(audio.data))
|
|
94
|
+
throw new Error('Audio file does not exist at the specified path: ' + audio.data);
|
|
95
95
|
|
|
96
|
-
file = fs.readFileSync(audio.
|
|
96
|
+
file = fs.readFileSync(audio.data);
|
|
97
97
|
} else {
|
|
98
|
-
file = await fetch(audio.
|
|
98
|
+
file = await fetch(audio.data).then(res => res.blob());
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
file = new File([file], 'audio.' + this.getExtFromMime(file.type), {type: file.type});
|