|
1 | | -var L = Object.defineProperty; |
2 | | -var M = (a, e, t) => e in a ? L(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t; |
3 | | -var s = (a, e, t) => (M(a, typeof e != "symbol" ? e + "" : e, t), t); |
4 | | -import { defineComponent as O, ref as h, onMounted as G, watchEffect as g, onUnmounted as $, openBlock as V, createElementBlock as P, normalizeStyle as y, createVNode as U, Transition as X, withCtx as H, withDirectives as w, createElementVNode as m, vShow as A } from "vue"; |
| 1 | +var E = Object.defineProperty; |
| 2 | +var L = (a, e, t) => e in a ? E(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t; |
| 3 | +var s = (a, e, t) => (L(a, typeof e != "symbol" ? e + "" : e, t), t); |
| 4 | +import { defineComponent as M, ref as h, onMounted as G, watchEffect as g, onUnmounted as $, openBlock as V, createElementBlock as P, normalizeStyle as y, createVNode as U, Transition as X, withCtx as H, withDirectives as w, createElementVNode as m, vShow as A } from "vue"; |
5 | 5 | class q { |
6 | 6 | constructor(e, t, i) { |
7 | 7 | s(this, "canvasCtx"); |
@@ -78,7 +78,7 @@ class Y { |
78 | 78 | } |
79 | 79 | async fetchAudioFile() { |
80 | 80 | try { |
81 | | - const e = await fetch(this.props.url); |
| 81 | + const e = await fetch(this.props.url, this.props.requestOptions); |
82 | 82 | this.arrayBuffer = await e.arrayBuffer(); |
83 | 83 | } catch (e) { |
84 | 84 | console.error(e); |
@@ -194,10 +194,11 @@ function Q(a, e) { |
194 | 194 | function Z() { |
195 | 195 | D.unobserve(); |
196 | 196 | } |
197 | | -const tt = /* @__PURE__ */ O({ |
| 197 | +const tt = /* @__PURE__ */ M({ |
198 | 198 | __name: "IllestWaveform", |
199 | 199 | props: { |
200 | 200 | url: null, |
| 201 | + requestOptions: { default: () => ({}) }, |
201 | 202 | lineWidth: { default: 0.5 }, |
202 | 203 | lineCap: { default: "round" }, |
203 | 204 | lineColor: { default: "#5e5e5e" }, |
@@ -280,19 +281,19 @@ const tt = /* @__PURE__ */ O({ |
280 | 281 | p.value <= o._audioDuration || F(); |
281 | 282 | }); |
282 | 283 | } |
283 | | - function z() { |
| 284 | + function O() { |
284 | 285 | return x(p.value); |
285 | 286 | } |
286 | | - function E() { |
| 287 | + function z() { |
287 | 288 | const u = o._audioDuration; |
288 | 289 | return x(u); |
289 | 290 | } |
290 | 291 | return e({ |
291 | 292 | play: b, |
292 | 293 | pause: R, |
293 | 294 | replay: W, |
294 | | - getCurrentTime: z, |
295 | | - getDuration: E |
| 295 | + getCurrentTime: O, |
| 296 | + getDuration: z |
296 | 297 | }), (u, at) => (V(), P("section", { |
297 | 298 | id: "illest-waveform", |
298 | 299 | ref_key: "__illestWaveformRef__", |
@@ -338,7 +339,7 @@ const et = (a, e) => { |
338 | 339 | for (const [i, n] of e) |
339 | 340 | t[i] = n; |
340 | 341 | return t; |
341 | | -}, it = /* @__PURE__ */ et(tt, [["__scopeId", "data-v-6d613eae"]]), ot = { |
| 342 | +}, it = /* @__PURE__ */ et(tt, [["__scopeId", "data-v-59075811"]]), ot = { |
342 | 343 | install: (a) => { |
343 | 344 | a.component("IllestWaveform", it); |
344 | 345 | } |
|
0 commit comments