@acorex/components 22.1.1 → 22.1.3
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.
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { AXComponent } from '@acorex/cdk/common';
|
|
2
|
-
import { AXSkeletonComponent
|
|
3
|
-
import { AXTranslatorPipe
|
|
4
|
-
import { isPlatformBrowser,
|
|
2
|
+
import { AXSkeletonComponent } from '@acorex/components/skeleton';
|
|
3
|
+
import { AXTranslatorPipe } from '@acorex/core/translation';
|
|
4
|
+
import { isPlatformBrowser, AsyncPipe } from '@angular/common';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { input, output, signal, inject, NgZone, PLATFORM_ID,
|
|
6
|
+
import { viewChild, input, output, signal, computed, inject, NgZone, PLATFORM_ID, DestroyRef, afterRenderEffect, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
|
7
7
|
import WaveSurfer from 'wavesurfer.js';
|
|
8
|
-
import { AXButtonModule } from '@acorex/components/button';
|
|
9
|
-
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
10
8
|
|
|
9
|
+
const DEFAULT_BAR_WIDTH = 2;
|
|
10
|
+
const DEFAULT_BAR_GAP = 2;
|
|
11
|
+
const DEFAULT_BAR_RADIUS = 2;
|
|
12
|
+
const DEFAULT_HEIGHT = 36;
|
|
13
|
+
const FALLBACK_RGB = '128, 128, 128';
|
|
11
14
|
/**
|
|
12
15
|
* Displays and interacts with audio waveform visualization.
|
|
13
16
|
*
|
|
@@ -15,9 +18,14 @@ import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
|
15
18
|
*/
|
|
16
19
|
class AXAudioWaveComponent {
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
21
|
+
* @ignore
|
|
19
22
|
*/
|
|
20
23
|
constructor() {
|
|
24
|
+
/**
|
|
25
|
+
* @ignore
|
|
26
|
+
*/
|
|
27
|
+
this.wave = viewChild('wave', /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "wave" }] : /* istanbul ignore next */ []));
|
|
21
29
|
/**
|
|
22
30
|
* Configuration settings for the audio wave.
|
|
23
31
|
*/
|
|
@@ -29,58 +37,89 @@ class AXAudioWaveComponent {
|
|
|
29
37
|
* @event
|
|
30
38
|
*/
|
|
31
39
|
this.onStatusChanged = output();
|
|
32
|
-
|
|
40
|
+
/**
|
|
41
|
+
* @ignore
|
|
42
|
+
*/
|
|
43
|
+
this.audioState = signal('loading', /* @ts-ignore */
|
|
33
44
|
...(ngDevMode ? [{ debugName: "audioState" }] : /* istanbul ignore next */ []));
|
|
45
|
+
/**
|
|
46
|
+
* @ignore
|
|
47
|
+
*/
|
|
34
48
|
this.errorMessage = signal('', /* @ts-ignore */
|
|
35
49
|
...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
36
50
|
/**
|
|
37
|
-
*
|
|
51
|
+
* @ignore
|
|
52
|
+
*/
|
|
53
|
+
this.isWaveVisible = computed(() => {
|
|
54
|
+
const state = this.audioState();
|
|
55
|
+
return state === 'ready' || state === 'playing' || state === 'paused';
|
|
56
|
+
}, /* @ts-ignore */
|
|
57
|
+
...(ngDevMode ? [{ debugName: "isWaveVisible" }] : /* istanbul ignore next */ []));
|
|
58
|
+
/**
|
|
59
|
+
* @ignore
|
|
60
|
+
*/
|
|
61
|
+
this.loadedUrl = '';
|
|
62
|
+
/**
|
|
63
|
+
* @ignore
|
|
64
|
+
*/
|
|
65
|
+
this.lastVisualKey = '';
|
|
66
|
+
/**
|
|
67
|
+
* @ignore
|
|
68
|
+
*/
|
|
69
|
+
this.isDestroyed = false;
|
|
70
|
+
/**
|
|
71
|
+
* @ignore
|
|
38
72
|
*/
|
|
39
73
|
this.ngZone = inject(NgZone);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
height: this.config()?.height || 36,
|
|
54
|
-
});
|
|
74
|
+
/**
|
|
75
|
+
* @ignore
|
|
76
|
+
*/
|
|
77
|
+
this.platformId = inject(PLATFORM_ID);
|
|
78
|
+
/**
|
|
79
|
+
* @ignore
|
|
80
|
+
*/
|
|
81
|
+
this.destroyRef = inject(DestroyRef);
|
|
82
|
+
afterRenderEffect(() => {
|
|
83
|
+
const container = this.wave()?.nativeElement;
|
|
84
|
+
const config = this.config();
|
|
85
|
+
if (this.isDestroyed || !isPlatformBrowser(this.platformId) || !container) {
|
|
86
|
+
return;
|
|
55
87
|
}
|
|
56
|
-
this.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
this.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
67
|
-
this.bindEvents();
|
|
88
|
+
if (!this.audio) {
|
|
89
|
+
this.createWaveSurfer(container, config);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.syncFromConfig(config);
|
|
93
|
+
});
|
|
94
|
+
this.destroyRef.onDestroy(() => {
|
|
95
|
+
this.isDestroyed = true;
|
|
96
|
+
this.audio?.destroy();
|
|
97
|
+
this.audio = undefined;
|
|
68
98
|
});
|
|
69
99
|
}
|
|
70
100
|
/**
|
|
71
101
|
* Loads the audio from the specified URL.
|
|
72
102
|
*
|
|
73
103
|
* @param url - The URL of the audio to load. Defaults to the URL from the config.
|
|
104
|
+
* @returns A promise that resolves when loading starts, or immediately when unavailable.
|
|
74
105
|
*/
|
|
75
|
-
load(url = this.config()
|
|
76
|
-
|
|
106
|
+
load(url = this.config()?.url) {
|
|
107
|
+
const nextUrl = url?.trim();
|
|
108
|
+
if (!this.audio || !nextUrl) {
|
|
109
|
+
return Promise.resolve();
|
|
110
|
+
}
|
|
111
|
+
this.loadedUrl = nextUrl;
|
|
112
|
+
this.audioState.set('loading');
|
|
113
|
+
this.errorMessage.set('');
|
|
114
|
+
return this.audio.load(nextUrl);
|
|
77
115
|
}
|
|
78
116
|
/**
|
|
79
117
|
* Plays the audio.
|
|
80
118
|
*
|
|
119
|
+
* @returns A promise that resolves when playback starts.
|
|
81
120
|
*/
|
|
82
121
|
play() {
|
|
83
|
-
return this.audio?.play();
|
|
122
|
+
return this.audio?.play() ?? Promise.resolve();
|
|
84
123
|
}
|
|
85
124
|
/**
|
|
86
125
|
* Pauses the audio.
|
|
@@ -89,19 +128,26 @@ class AXAudioWaveComponent {
|
|
|
89
128
|
this.audio?.pause();
|
|
90
129
|
}
|
|
91
130
|
/**
|
|
92
|
-
* Retrieves the duration of the audio.
|
|
131
|
+
* Retrieves the duration of the audio in seconds.
|
|
93
132
|
*
|
|
133
|
+
* @returns The audio duration, or `0` when unavailable.
|
|
94
134
|
*/
|
|
95
135
|
getDuration() {
|
|
96
136
|
return this.audio?.getDuration() ?? 0;
|
|
97
137
|
}
|
|
98
138
|
/**
|
|
99
|
-
* Retrieves the media element
|
|
139
|
+
* Retrieves the underlying HTML media element.
|
|
100
140
|
*
|
|
141
|
+
* @returns The media element used by WaveSurfer, or `undefined` when unavailable.
|
|
101
142
|
*/
|
|
102
143
|
getMediaElement() {
|
|
103
144
|
return this.audio?.getMediaElement();
|
|
104
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Retrieves the current playback position in seconds.
|
|
148
|
+
*
|
|
149
|
+
* @returns The current time, or `0` when unavailable.
|
|
150
|
+
*/
|
|
105
151
|
getCurrentTime() {
|
|
106
152
|
return this.audio?.getCurrentTime() ?? this.getMediaElement()?.currentTime ?? 0;
|
|
107
153
|
}
|
|
@@ -111,289 +157,231 @@ class AXAudioWaveComponent {
|
|
|
111
157
|
* @param rate - The playback rate to set.
|
|
112
158
|
*/
|
|
113
159
|
setRate(rate) {
|
|
114
|
-
this.audio
|
|
160
|
+
this.audio?.setPlaybackRate(rate);
|
|
115
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Mutes or unmutes the audio.
|
|
164
|
+
*
|
|
165
|
+
* @param muted - Whether the audio should be muted.
|
|
166
|
+
*/
|
|
116
167
|
setMuted(muted) {
|
|
117
|
-
|
|
118
|
-
if (media) {
|
|
119
|
-
media.muted = muted;
|
|
120
|
-
}
|
|
121
|
-
this.audio?.setVolume(muted ? 0 : 1);
|
|
168
|
+
this.audio?.setMuted(muted);
|
|
122
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Indicates whether the audio is currently muted.
|
|
172
|
+
*
|
|
173
|
+
* @returns True when muted; otherwise false.
|
|
174
|
+
*/
|
|
123
175
|
isMuted() {
|
|
124
|
-
|
|
125
|
-
return media?.muted ?? this.audio?.getVolume() === 0;
|
|
176
|
+
return this.audio?.getMuted() ?? false;
|
|
126
177
|
}
|
|
127
178
|
/**
|
|
128
|
-
*
|
|
179
|
+
* @ignore
|
|
129
180
|
*/
|
|
130
|
-
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
133
|
-
this.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
this.handlePlay();
|
|
137
|
-
this.handlePause();
|
|
138
|
-
this.handleFinish();
|
|
139
|
-
this.handleTimeUpdate();
|
|
140
|
-
this.handleSeeking();
|
|
141
|
-
this.handleInteraction();
|
|
142
|
-
this.handleClick();
|
|
143
|
-
this.handleDrag();
|
|
144
|
-
this.handleScroll();
|
|
145
|
-
this.handleZoom();
|
|
146
|
-
this.handleDestroy();
|
|
147
|
-
this.handleError();
|
|
148
|
-
}
|
|
149
|
-
/** When audio starts loading */
|
|
150
|
-
handleLoad() {
|
|
151
|
-
this.audio?.on('load', (url) => {
|
|
152
|
-
this.ngZone.run(() => {
|
|
153
|
-
this.onStatusChanged.emit({
|
|
154
|
-
component: this,
|
|
155
|
-
data: { url: url },
|
|
156
|
-
status: 'load',
|
|
157
|
-
isUserInteraction: false,
|
|
158
|
-
});
|
|
159
|
-
});
|
|
181
|
+
createWaveSurfer(container, config) {
|
|
182
|
+
const visualOptions = this.resolveVisualOptions(config);
|
|
183
|
+
this.lastVisualKey = JSON.stringify(visualOptions);
|
|
184
|
+
this.audio = WaveSurfer.create({
|
|
185
|
+
container,
|
|
186
|
+
...visualOptions,
|
|
160
187
|
});
|
|
188
|
+
this.bindEvents();
|
|
189
|
+
this.applyUrlAndRate(config);
|
|
161
190
|
}
|
|
162
|
-
/**
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
191
|
+
/**
|
|
192
|
+
* @ignore
|
|
193
|
+
*/
|
|
194
|
+
syncFromConfig(config) {
|
|
195
|
+
if (!this.audio) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const visualOptions = this.resolveVisualOptions(config);
|
|
199
|
+
const visualKey = JSON.stringify(visualOptions);
|
|
200
|
+
if (visualKey !== this.lastVisualKey) {
|
|
201
|
+
this.lastVisualKey = visualKey;
|
|
202
|
+
this.audio.setOptions(visualOptions);
|
|
203
|
+
}
|
|
204
|
+
this.applyUrlAndRate(config);
|
|
174
205
|
}
|
|
175
|
-
/**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
206
|
+
/**
|
|
207
|
+
* @ignore
|
|
208
|
+
*/
|
|
209
|
+
applyUrlAndRate(config) {
|
|
210
|
+
const url = config?.url?.trim() ?? '';
|
|
211
|
+
if (url && url !== this.loadedUrl) {
|
|
212
|
+
this.loadedUrl = url;
|
|
213
|
+
void this.audio?.load(url);
|
|
214
|
+
}
|
|
215
|
+
else if (!url) {
|
|
216
|
+
queueMicrotask(() => {
|
|
217
|
+
if (!this.isDestroyed && !this.loadedUrl && this.audioState() === 'loading') {
|
|
218
|
+
this.audioState.set('paused');
|
|
219
|
+
}
|
|
185
220
|
});
|
|
186
|
-
}
|
|
221
|
+
}
|
|
222
|
+
if (config?.audioRate != null) {
|
|
223
|
+
this.audio?.setPlaybackRate(config.audioRate);
|
|
224
|
+
}
|
|
187
225
|
}
|
|
188
|
-
/**
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
226
|
+
/**
|
|
227
|
+
* @ignore
|
|
228
|
+
*/
|
|
229
|
+
resolveVisualOptions(config) {
|
|
230
|
+
const primary200 = this.readCssRgbVar('--ax-sys-color-primary-200');
|
|
231
|
+
const primary700 = this.readCssRgbVar('--ax-sys-color-primary-700');
|
|
232
|
+
return {
|
|
233
|
+
waveColor: config?.waveColor ?? `rgba(${primary200})`,
|
|
234
|
+
progressColor: config?.progressColor ?? `rgba(${primary700})`,
|
|
235
|
+
barWidth: config?.barWidth ?? DEFAULT_BAR_WIDTH,
|
|
236
|
+
barGap: config?.barGap ?? DEFAULT_BAR_GAP,
|
|
237
|
+
barRadius: config?.barRadius ?? DEFAULT_BAR_RADIUS,
|
|
238
|
+
height: config?.height ?? DEFAULT_HEIGHT,
|
|
239
|
+
};
|
|
200
240
|
}
|
|
201
|
-
/**
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
isUserInteraction: false,
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
});
|
|
241
|
+
/**
|
|
242
|
+
* @ignore
|
|
243
|
+
*/
|
|
244
|
+
readCssRgbVar(name) {
|
|
245
|
+
if (!isPlatformBrowser(this.platformId)) {
|
|
246
|
+
return FALLBACK_RGB;
|
|
247
|
+
}
|
|
248
|
+
return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || FALLBACK_RGB;
|
|
213
249
|
}
|
|
214
|
-
/**
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
250
|
+
/**
|
|
251
|
+
* @ignore
|
|
252
|
+
*/
|
|
253
|
+
bindEvents() {
|
|
254
|
+
if (!this.audio) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
this.audio.on('load', (url) => {
|
|
258
|
+
this.emitStatus('load', { url }, false);
|
|
221
259
|
});
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
this.onStatusChanged.emit({ component: this, data: null, status: 'pause', isUserInteraction: false });
|
|
260
|
+
this.audio.on('loading', (percent) => {
|
|
261
|
+
this.runInZone(() => {
|
|
262
|
+
this.errorMessage.set('');
|
|
263
|
+
this.audioState.set('loading');
|
|
264
|
+
this.emitStatus('loading', { percent }, false, false);
|
|
228
265
|
});
|
|
229
266
|
});
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
handleFinish() {
|
|
233
|
-
this.audio?.on('finish', () => {
|
|
234
|
-
this.ngZone.run(() => {
|
|
235
|
-
this.onStatusChanged.emit({
|
|
236
|
-
component: this,
|
|
237
|
-
data: null,
|
|
238
|
-
status: 'finish',
|
|
239
|
-
isUserInteraction: false,
|
|
240
|
-
});
|
|
241
|
-
});
|
|
267
|
+
this.audio.on('decode', (duration) => {
|
|
268
|
+
this.emitStatus('decode', { duration }, false);
|
|
242
269
|
});
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
this.
|
|
249
|
-
component: this,
|
|
250
|
-
data: { currentTime: currentTime },
|
|
251
|
-
status: 'timeupdate',
|
|
252
|
-
isUserInteraction: false,
|
|
253
|
-
});
|
|
270
|
+
this.audio.on('ready', (duration) => {
|
|
271
|
+
this.runInZone(() => {
|
|
272
|
+
if (this.audioState() !== 'playing') {
|
|
273
|
+
this.audioState.set('ready');
|
|
274
|
+
}
|
|
275
|
+
this.emitStatus('ready', { duration }, false, false);
|
|
254
276
|
});
|
|
255
277
|
});
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
handleSeeking() {
|
|
259
|
-
this.audio?.on('seeking', (currentTime) => {
|
|
260
|
-
this.ngZone.run(() => {
|
|
261
|
-
this.onStatusChanged.emit({
|
|
262
|
-
component: this,
|
|
263
|
-
data: { currentTime: currentTime },
|
|
264
|
-
status: 'seeking',
|
|
265
|
-
isUserInteraction: false,
|
|
266
|
-
});
|
|
267
|
-
});
|
|
278
|
+
this.audio.on('redrawcomplete', () => {
|
|
279
|
+
this.emitStatus('redrawcomplete', null, false);
|
|
268
280
|
});
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
this.ngZone.run(() => {
|
|
274
|
-
this.onStatusChanged.emit({
|
|
275
|
-
component: this,
|
|
276
|
-
data: { newTime: newTime },
|
|
277
|
-
status: 'interaction',
|
|
278
|
-
isUserInteraction: false,
|
|
279
|
-
});
|
|
281
|
+
this.audio.on('play', () => {
|
|
282
|
+
this.runInZone(() => {
|
|
283
|
+
this.audioState.set('playing');
|
|
284
|
+
this.emitStatus('play', null, false, false);
|
|
280
285
|
});
|
|
281
286
|
});
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
this.
|
|
288
|
-
component: this,
|
|
289
|
-
data: { relativeX: relativeX },
|
|
290
|
-
status: 'click',
|
|
291
|
-
isUserInteraction: false,
|
|
292
|
-
});
|
|
287
|
+
this.audio.on('pause', () => {
|
|
288
|
+
this.runInZone(() => {
|
|
289
|
+
if (this.audioState() !== 'error') {
|
|
290
|
+
this.audioState.set('paused');
|
|
291
|
+
}
|
|
292
|
+
this.emitStatus('pause', null, false, false);
|
|
293
293
|
});
|
|
294
294
|
});
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
this.ngZone.run(() => {
|
|
300
|
-
this.onStatusChanged.emit({
|
|
301
|
-
component: this,
|
|
302
|
-
data: { relativeX: relativeX },
|
|
303
|
-
status: 'drag',
|
|
304
|
-
isUserInteraction: false,
|
|
305
|
-
});
|
|
295
|
+
this.audio.on('finish', () => {
|
|
296
|
+
this.runInZone(() => {
|
|
297
|
+
this.audioState.set('paused');
|
|
298
|
+
this.emitStatus('finish', null, false, false);
|
|
306
299
|
});
|
|
307
300
|
});
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
handleScroll() {
|
|
311
|
-
this.audio?.on('scroll', (visibleStartTime, visibleEndTime) => {
|
|
312
|
-
this.ngZone.run(() => {
|
|
313
|
-
this.onStatusChanged.emit({
|
|
314
|
-
component: this,
|
|
315
|
-
data: { visibleStartTime, visibleEndTime },
|
|
316
|
-
status: 'scroll',
|
|
317
|
-
isUserInteraction: false,
|
|
318
|
-
});
|
|
319
|
-
});
|
|
301
|
+
this.audio.on('timeupdate', (currentTime) => {
|
|
302
|
+
this.emitStatus('timeupdate', { currentTime }, false);
|
|
320
303
|
});
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
handleZoom() {
|
|
324
|
-
this.audio?.on('zoom', (minPxPerSec) => {
|
|
325
|
-
this.ngZone.run(() => {
|
|
326
|
-
this.onStatusChanged.emit({
|
|
327
|
-
component: this,
|
|
328
|
-
data: { minPxPerSec: minPxPerSec },
|
|
329
|
-
status: 'zoom',
|
|
330
|
-
isUserInteraction: false,
|
|
331
|
-
});
|
|
332
|
-
});
|
|
304
|
+
this.audio.on('seeking', (currentTime) => {
|
|
305
|
+
this.emitStatus('seeking', { currentTime }, true);
|
|
333
306
|
});
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
this.audio
|
|
338
|
-
this.
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
307
|
+
this.audio.on('interaction', (newTime) => {
|
|
308
|
+
this.emitStatus('interaction', { newTime }, true);
|
|
309
|
+
});
|
|
310
|
+
this.audio.on('click', (relativeX, relativeY) => {
|
|
311
|
+
this.emitStatus('click', { relativeX, relativeY }, true);
|
|
312
|
+
});
|
|
313
|
+
this.audio.on('drag', (relativeX) => {
|
|
314
|
+
this.emitStatus('drag', { relativeX }, true);
|
|
315
|
+
});
|
|
316
|
+
this.audio.on('scroll', (visibleStartTime, visibleEndTime) => {
|
|
317
|
+
this.emitStatus('scroll', { visibleStartTime, visibleEndTime }, true);
|
|
318
|
+
});
|
|
319
|
+
this.audio.on('zoom', (minPxPerSec) => {
|
|
320
|
+
this.emitStatus('zoom', { minPxPerSec }, false);
|
|
321
|
+
});
|
|
322
|
+
this.audio.on('destroy', () => {
|
|
323
|
+
this.emitStatus('destroy', null, false);
|
|
324
|
+
});
|
|
325
|
+
this.audio.on('error', (error) => {
|
|
326
|
+
this.runInZone(() => {
|
|
327
|
+
const message = error?.message ?? '';
|
|
328
|
+
this.errorMessage.set(message);
|
|
329
|
+
this.audioState.set('error');
|
|
330
|
+
this.emitStatus('error', { message }, false, false);
|
|
345
331
|
});
|
|
346
332
|
});
|
|
347
333
|
}
|
|
348
|
-
/**
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
334
|
+
/**
|
|
335
|
+
* @ignore
|
|
336
|
+
*/
|
|
337
|
+
emitStatus(status, data, isUserInteraction, wrapInZone = true) {
|
|
338
|
+
if (this.isDestroyed) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const emit = () => {
|
|
342
|
+
this.onStatusChanged.emit({
|
|
343
|
+
component: this,
|
|
344
|
+
data,
|
|
345
|
+
status,
|
|
346
|
+
isUserInteraction,
|
|
353
347
|
});
|
|
354
|
-
}
|
|
348
|
+
};
|
|
349
|
+
if (wrapInZone) {
|
|
350
|
+
this.runInZone(emit);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
emit();
|
|
355
354
|
}
|
|
356
|
-
|
|
357
|
-
|
|
355
|
+
/**
|
|
356
|
+
* @ignore
|
|
357
|
+
*/
|
|
358
|
+
runInZone(fn) {
|
|
359
|
+
if (this.isDestroyed) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
this.ngZone.run(fn);
|
|
358
363
|
}
|
|
359
364
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXAudioWaveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
360
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXAudioWaveComponent, isStandalone: true, selector: "ax-audio-wave", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onStatusChanged: "onStatusChanged" }, providers: [{ provide: AXComponent, useExisting: AXAudioWaveComponent }], viewQueries: [{ propertyName: "
|
|
365
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXAudioWaveComponent, isStandalone: true, selector: "ax-audio-wave", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onStatusChanged: "onStatusChanged" }, host: { properties: { "attr.aria-busy": "audioState() === \"loading\" || null", "attr.aria-invalid": "audioState() === \"error\" || null" } }, providers: [{ provide: AXComponent, useExisting: AXAudioWaveComponent }], viewQueries: [{ propertyName: "wave", first: true, predicate: ["wave"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ax-audio-wave-host\" [class.ax-audio-wave-host--loading]=\"audioState() === 'loading'\">\n <div class=\"ax-audio-wave\" #wave [class.ax-audio-wave--hidden]=\"!isWaveVisible()\"></div>\n\n @switch (audioState()) {\n @case ('loading') {\n <ax-skeleton class=\"ax-audio-wave-skeleton\"></ax-skeleton>\n }\n @case ('error') {\n <div class=\"ax-wave-message\">\n {{ '@acorex:error.message' | translate: { params: { message: errorMessage() } } | async }}\n </div>\n }\n }\n</div>\n", styles: ["@layer properties;@layer components{ax-audio-wave{display:block;width:100%;flex:1}ax-audio-wave .ax-audio-wave-host{position:relative;display:block;width:100%}ax-audio-wave .ax-audio-wave-host--loading{min-height:1.25rem}ax-audio-wave .ax-audio-wave{width:100%}ax-audio-wave .ax-audio-wave--hidden{visibility:hidden}ax-audio-wave .ax-audio-wave-skeleton{position:absolute;inset-inline:calc(var(--spacing, .25rem) * 0);top:50%;height:calc(var(--spacing, .25rem) * 5);width:100%;--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(infinity * 1px)}ax-audio-wave .ax-wave-message{position:absolute;inset-inline:calc(var(--spacing, .25rem) * 0);top:50%;--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);padding-inline-start:calc(var(--spacing, .25rem) * 2)}}@property --tw-translate-x{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: \"*\"; inherits: false; initial-value: 0;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
361
366
|
}
|
|
362
367
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXAudioWaveComponent, decorators: [{
|
|
363
368
|
type: Component,
|
|
364
|
-
args: [{ selector: 'ax-audio-wave', encapsulation: ViewEncapsulation.None, imports: [
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
+
args: [{ selector: 'ax-audio-wave', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AsyncPipe, AXTranslatorPipe, AXSkeletonComponent], providers: [{ provide: AXComponent, useExisting: AXAudioWaveComponent }], host: {
|
|
370
|
+
'[attr.aria-busy]': 'audioState() === "loading" || null',
|
|
371
|
+
'[attr.aria-invalid]': 'audioState() === "error" || null',
|
|
372
|
+
}, template: "<div class=\"ax-audio-wave-host\" [class.ax-audio-wave-host--loading]=\"audioState() === 'loading'\">\n <div class=\"ax-audio-wave\" #wave [class.ax-audio-wave--hidden]=\"!isWaveVisible()\"></div>\n\n @switch (audioState()) {\n @case ('loading') {\n <ax-skeleton class=\"ax-audio-wave-skeleton\"></ax-skeleton>\n }\n @case ('error') {\n <div class=\"ax-wave-message\">\n {{ '@acorex:error.message' | translate: { params: { message: errorMessage() } } | async }}\n </div>\n }\n }\n</div>\n", styles: ["@layer properties;@layer components{ax-audio-wave{display:block;width:100%;flex:1}ax-audio-wave .ax-audio-wave-host{position:relative;display:block;width:100%}ax-audio-wave .ax-audio-wave-host--loading{min-height:1.25rem}ax-audio-wave .ax-audio-wave{width:100%}ax-audio-wave .ax-audio-wave--hidden{visibility:hidden}ax-audio-wave .ax-audio-wave-skeleton{position:absolute;inset-inline:calc(var(--spacing, .25rem) * 0);top:50%;height:calc(var(--spacing, .25rem) * 5);width:100%;--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(infinity * 1px)}ax-audio-wave .ax-wave-message{position:absolute;inset-inline:calc(var(--spacing, .25rem) * 0);top:50%;--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);padding-inline-start:calc(var(--spacing, .25rem) * 2)}}@property --tw-translate-x{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: \"*\"; inherits: false; initial-value: 0;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0}}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
|
|
373
|
+
}], ctorParameters: () => [], propDecorators: { wave: [{ type: i0.ViewChild, args: ['wave', { isSignal: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], onStatusChanged: [{ type: i0.Output, args: ["onStatusChanged"] }] } });
|
|
369
374
|
|
|
370
375
|
class AXAudioWaveModule {
|
|
371
376
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXAudioWaveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
372
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXAudioWaveModule, imports: [
|
|
373
|
-
|
|
374
|
-
AXDecoratorModule,
|
|
375
|
-
AXSkeletonModule,
|
|
376
|
-
AXTranslationModule,
|
|
377
|
-
AXAudioWaveComponent], exports: [AXAudioWaveComponent] }); }
|
|
378
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXAudioWaveModule, imports: [CommonModule,
|
|
379
|
-
AXButtonModule,
|
|
380
|
-
AXDecoratorModule,
|
|
381
|
-
AXSkeletonModule,
|
|
382
|
-
AXTranslationModule,
|
|
383
|
-
AXAudioWaveComponent] }); }
|
|
377
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXAudioWaveModule, imports: [AXAudioWaveComponent], exports: [AXAudioWaveComponent] }); }
|
|
378
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXAudioWaveModule, imports: [AXAudioWaveComponent] }); }
|
|
384
379
|
}
|
|
385
380
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXAudioWaveModule, decorators: [{
|
|
386
381
|
type: NgModule,
|
|
387
382
|
args: [{
|
|
388
383
|
exports: [AXAudioWaveComponent],
|
|
389
|
-
imports: [
|
|
390
|
-
CommonModule,
|
|
391
|
-
AXButtonModule,
|
|
392
|
-
AXDecoratorModule,
|
|
393
|
-
AXSkeletonModule,
|
|
394
|
-
AXTranslationModule,
|
|
395
|
-
AXAudioWaveComponent,
|
|
396
|
-
],
|
|
384
|
+
imports: [AXAudioWaveComponent],
|
|
397
385
|
}]
|
|
398
386
|
}] });
|
|
399
387
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-audio-wave.mjs","sources":["../../../../packages/components/audio-wave/src/lib/audio-wave.component.ts","../../../../packages/components/audio-wave/src/lib/audio-wave.component.html","../../../../packages/components/audio-wave/src/lib/audio-wave.module.ts","../../../../packages/components/audio-wave/src/acorex-components-audio-wave.ts"],"sourcesContent":["import { AXComponent } from '@acorex/cdk/common';\nimport { AXSkeletonComponent } from '@acorex/components/skeleton';\nimport { AXTranslatorPipe } from '@acorex/core/translation';\nimport { AsyncPipe, isPlatformBrowser, NgStyle } from '@angular/common';\nimport {\n afterNextRender,\n Component,\n ElementRef,\n inject,\n input,\n InputSignal,\n NgZone,\n OnDestroy,\n output,\n PLATFORM_ID,\n signal,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport WaveSurfer from 'wavesurfer.js';\nimport { AXAudioWaveChangeEvent, AXWaveConfig } from './interfaces/audio-wave.interface';\n\n/**\n * Displays and interacts with audio waveform visualization.\n *\n * @category Components\n */\n@Component({\n selector: 'ax-audio-wave',\n templateUrl: './audio-wave.component.html',\n styleUrls: ['./audio-wave.component.css'],\n encapsulation: ViewEncapsulation.None,\n imports: [NgStyle, AsyncPipe, AXTranslatorPipe, AXSkeletonComponent],\n providers: [{ provide: AXComponent, useExisting: AXAudioWaveComponent }],\n})\nexport class AXAudioWaveComponent implements OnDestroy {\n /**\n * @ignore\n */\n @ViewChild('d', { static: false }) protected div: ElementRef<HTMLDivElement>;\n\n /**\n * Configuration settings for the audio wave.\n */\n config: InputSignal<AXWaveConfig> = input<AXWaveConfig>();\n\n /**\n * Emits an event when the status of the audio wave changes.\n *\n * @event\n */\n onStatusChanged = output<AXAudioWaveChangeEvent>();\n\n audioState = signal<'playing' | 'paused' | 'loading' | 'ready' | 'error'>('paused');\n\n errorMessage = signal('');\n\n /**\n * @ignore\n */\n protected audio: WaveSurfer;\n\n /**\n * @ignore\n */\n private ngZone = inject(NgZone);\n\n private platformID = inject(PLATFORM_ID);\n /**\n * @ignore\n */\n constructor() {\n afterNextRender(() => {\n if (isPlatformBrowser(this.platformID)) {\n const primary200 = getComputedStyle(document.body).getPropertyValue('--ax-sys-color-primary-200');\n const primary700 = getComputedStyle(document.body).getPropertyValue('--ax-sys-color-primary-700');\n\n this.audio = WaveSurfer.create({\n container: this.div.nativeElement,\n waveColor: this.config()?.waveColor || `rgba(${primary200})`,\n progressColor: this.config()?.progressColor || `rgba(${primary700})`,\n url: this.config()?.url || '',\n barWidth: this.config()?.barWidth || 2,\n barRadius: this.config()?.barRadius || 2,\n barGap: this.config()?.barGap || 2,\n height: this.config()?.height || 36,\n });\n }\n this.load();\n this.audio?.on('loading', () => {\n this.audioState.set('loading');\n });\n this.audio?.on('ready', () => {\n this.audioState.set('ready');\n });\n this.audio?.on('error', (e) => {\n this.errorMessage.set(e?.message);\n this.audioState.set('error');\n });\n this.bindEvents();\n });\n }\n\n /**\n * Loads the audio from the specified URL.\n *\n * @param url - The URL of the audio to load. Defaults to the URL from the config.\n */\n load(url = this.config().url) {\n this.audio.load(url);\n }\n\n /**\n * Plays the audio.\n *\n */\n play(): Promise<any> {\n return this.audio?.play();\n }\n\n /**\n * Pauses the audio.\n */\n pause(): void {\n this.audio?.pause();\n }\n\n /**\n * Retrieves the duration of the audio.\n *\n */\n getDuration() {\n return this.audio?.getDuration() ?? 0;\n }\n\n /**\n * Retrieves the media element of the audio.\n *\n */\n getMediaElement() {\n return this.audio?.getMediaElement();\n }\n\n getCurrentTime() {\n return this.audio?.getCurrentTime() ?? this.getMediaElement()?.currentTime ?? 0;\n }\n\n /**\n * Sets the playback rate of the audio.\n *\n * @param rate - The playback rate to set.\n */\n setRate(rate: number) {\n this.audio.setPlaybackRate(rate);\n }\n\n setMuted(muted: boolean) {\n const media = this.getMediaElement();\n if (media) {\n media.muted = muted;\n }\n this.audio?.setVolume(muted ? 0 : 1);\n }\n\n isMuted() {\n const media = this.getMediaElement();\n return media?.muted ?? this.audio?.getVolume() === 0;\n }\n\n /**\n * @ignore\n */\n protected bindEvents() {\n this.handleLoad();\n this.handleLoading();\n this.handleDecode();\n this.handleReady();\n this.handleRedRawComplete();\n this.handlePlay();\n this.handlePause();\n this.handleFinish();\n this.handleTimeUpdate();\n this.handleSeeking();\n this.handleInteraction();\n this.handleClick();\n this.handleDrag();\n this.handleScroll();\n this.handleZoom();\n this.handleDestroy();\n this.handleError();\n }\n /** When audio starts loading */\n protected handleLoad() {\n this.audio?.on('load', (url) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { url: url },\n status: 'load',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** During audio loading */\n protected handleLoading() {\n this.audio?.on('loading', (percent) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { percent: percent },\n status: 'loading',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** When the audio has been decoded */\n protected handleDecode() {\n this.audio?.on('decode', (duration) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { duration: duration },\n status: 'decode',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** When the audio is both decoded and can play */\n protected handleReady() {\n this.audio?.on('ready', (duration) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { duration: duration },\n status: 'ready',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** When all audio channel chunks of the waveform have drawn */\n protected handleRedRawComplete() {\n this.audio?.on('redrawcomplete', () => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: null,\n status: 'redrawcomplete',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** When the audio starts playing */\n protected handlePlay() {\n this.audio?.on('play', () => {\n this.ngZone.run(() => {\n this.audioState.set('ready');\n this.onStatusChanged.emit({ component: this, data: null, status: 'play', isUserInteraction: false });\n });\n });\n }\n\n /** When the audio pauses */\n protected handlePause() {\n this.audio?.on('pause', () => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({ component: this, data: null, status: 'pause', isUserInteraction: false });\n });\n });\n }\n\n /** When the audio finishes playing */\n protected handleFinish() {\n this.audio?.on('finish', () => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: null,\n status: 'finish',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** On audio position change, fires continuously during playback */\n protected handleTimeUpdate() {\n this.audio?.on('timeupdate', (currentTime) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { currentTime: currentTime },\n status: 'timeupdate',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** When the user seeks to a new position */\n protected handleSeeking() {\n this.audio?.on('seeking', (currentTime) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { currentTime: currentTime },\n status: 'seeking',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** When the user interacts with the waveform (i.g. clicks or drags on it) */\n protected handleInteraction() {\n this.audio?.on('interaction', (newTime) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { newTime: newTime },\n status: 'interaction',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** When the user clicks on the waveform */\n protected handleClick() {\n this.audio?.on('click', (relativeX) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { relativeX: relativeX },\n status: 'click',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** When the user drags the cursor */\n protected handleDrag() {\n this.audio?.on('drag', (relativeX) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { relativeX: relativeX },\n status: 'drag',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** When the waveform is scrolled (panned) */\n protected handleScroll() {\n this.audio?.on('scroll', (visibleStartTime, visibleEndTime) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { visibleStartTime, visibleEndTime },\n status: 'scroll',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** When the zoom level changes */\n protected handleZoom() {\n this.audio?.on('zoom', (minPxPerSec) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: { minPxPerSec: minPxPerSec },\n status: 'zoom',\n isUserInteraction: false,\n });\n });\n });\n }\n\n /** Just before the waveform is destroyed so you can clean up your events */\n protected handleDestroy() {\n this.audio?.on('destroy', () => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({\n component: this,\n data: null,\n status: 'destroy',\n isUserInteraction: false,\n });\n });\n });\n }\n /** Just before the waveform is destroyed so you can clean up your events */\n protected handleError() {\n this.audio?.on('error', (e) => {\n this.ngZone.run(() => {\n this.onStatusChanged.emit({ component: this, data: e, status: 'error', isUserInteraction: false });\n });\n });\n }\n\n ngOnDestroy(): void {\n this.audio.destroy();\n }\n}\n","<div class=\"ax-audio-wave\" #d [ngStyle]=\"{ display: audioState() === 'ready' ? 'block' : 'none' }\"></div>\n\n@switch (audioState()) {\n @case ('loading') {\n <ax-skeleton class=\"h-5 w-full rounded-full\"></ax-skeleton>\n }\n @case ('error') {\n <div class=\"ax-wave-message\">\n {{ '@acorex:error.message' | translate: { params: { message: errorMessage() } } | async }}\n </div>\n }\n}\n","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXSkeletonModule } from '@acorex/components/skeleton';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXAudioWaveComponent } from './audio-wave.component';\n\n@NgModule({\n exports: [AXAudioWaveComponent],\n imports: [\n CommonModule,\n AXButtonModule,\n AXDecoratorModule,\n AXSkeletonModule,\n AXTranslationModule,\n AXAudioWaveComponent,\n ],\n})\nexport class AXAudioWaveModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAsBA;;;;AAIG;MASU,oBAAoB,CAAA;AAiC/B;;AAEG;AACH,IAAA,WAAA,GAAA;AA9BA;;AAEG;AACH,QAAA,IAAA,CAAA,MAAM,GAA8B,KAAK;8FAAgB;AAEzD;;;;AAIG;QACH,IAAA,CAAA,eAAe,GAAG,MAAM,EAA0B;QAElD,IAAA,CAAA,UAAU,GAAG,MAAM,CAAuD,QAAQ;uFAAC;QAEnF,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,EAAE;yFAAC;AAOzB;;AAEG;AACK,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAEvB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QAKtC,eAAe,CAAC,MAAK;AACnB,YAAA,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;AACtC,gBAAA,MAAM,UAAU,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,4BAA4B,CAAC;AACjG,gBAAA,MAAM,UAAU,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,4BAA4B,CAAC;AAEjG,gBAAA,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC;AAC7B,oBAAA,SAAS,EAAE,IAAI,CAAC,GAAG,CAA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;wBACZ,cAAc;wBACd,iBAAiB;wBACjB,gBAAgB;wBAChB,mBAAmB;wBACnB,oBAAoB;AACrB,qBAAA;AACF,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-components-audio-wave.mjs","sources":["../../../../packages/components/audio-wave/src/lib/audio-wave.component.ts","../../../../packages/components/audio-wave/src/lib/audio-wave.component.html","../../../../packages/components/audio-wave/src/lib/audio-wave.module.ts","../../../../packages/components/audio-wave/src/acorex-components-audio-wave.ts"],"sourcesContent":["import { AXComponent } from '@acorex/cdk/common';\nimport { AXSkeletonComponent } from '@acorex/components/skeleton';\nimport { AXTranslatorPipe } from '@acorex/core/translation';\nimport { AsyncPipe, isPlatformBrowser } from '@angular/common';\nimport {\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n NgZone,\n output,\n PLATFORM_ID,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport WaveSurfer from 'wavesurfer.js';\nimport type {\n AXAudioWaveChangeEvent,\n AXAudioWaveEventPayload,\n AXAudioWaveState,\n AXAudioWaveStatus,\n AXWaveConfig,\n} from './interfaces/audio-wave.interface';\n\nconst DEFAULT_BAR_WIDTH = 2;\nconst DEFAULT_BAR_GAP = 2;\nconst DEFAULT_BAR_RADIUS = 2;\nconst DEFAULT_HEIGHT = 36;\nconst FALLBACK_RGB = '128, 128, 128';\n\n/**\n * Displays and interacts with audio waveform visualization.\n *\n * @category Components\n */\n@Component({\n selector: 'ax-audio-wave',\n templateUrl: './audio-wave.component.html',\n styleUrls: ['./audio-wave.component.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AsyncPipe, AXTranslatorPipe, AXSkeletonComponent],\n providers: [{ provide: AXComponent, useExisting: AXAudioWaveComponent }],\n host: {\n '[attr.aria-busy]': 'audioState() === \"loading\" || null',\n '[attr.aria-invalid]': 'audioState() === \"error\" || null',\n },\n})\nexport class AXAudioWaveComponent {\n /**\n * @ignore\n */\n private readonly wave = viewChild<ElementRef<HTMLDivElement>>('wave');\n\n /**\n * Configuration settings for the audio wave.\n */\n readonly config = input<AXWaveConfig>();\n\n /**\n * Emits an event when the status of the audio wave changes.\n *\n * @event\n */\n readonly onStatusChanged = output<AXAudioWaveChangeEvent>();\n\n /**\n * @ignore\n */\n protected readonly audioState = signal<AXAudioWaveState>('loading');\n\n /**\n * @ignore\n */\n protected readonly errorMessage = signal('');\n\n /**\n * @ignore\n */\n protected readonly isWaveVisible = computed(() => {\n const state = this.audioState();\n return state === 'ready' || state === 'playing' || state === 'paused';\n });\n\n /**\n * @ignore\n */\n private audio: WaveSurfer | undefined;\n\n /**\n * @ignore\n */\n private loadedUrl = '';\n\n /**\n * @ignore\n */\n private lastVisualKey = '';\n\n /**\n * @ignore\n */\n private isDestroyed = false;\n\n /**\n * @ignore\n */\n private readonly ngZone = inject(NgZone);\n\n /**\n * @ignore\n */\n private readonly platformId = inject(PLATFORM_ID);\n\n /**\n * @ignore\n */\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * @ignore\n */\n constructor() {\n afterRenderEffect(() => {\n const container = this.wave()?.nativeElement;\n const config = this.config();\n\n if (this.isDestroyed || !isPlatformBrowser(this.platformId) || !container) {\n return;\n }\n\n if (!this.audio) {\n this.createWaveSurfer(container, config);\n return;\n }\n\n this.syncFromConfig(config);\n });\n\n this.destroyRef.onDestroy(() => {\n this.isDestroyed = true;\n this.audio?.destroy();\n this.audio = undefined;\n });\n }\n\n /**\n * Loads the audio from the specified URL.\n *\n * @param url - The URL of the audio to load. Defaults to the URL from the config.\n * @returns A promise that resolves when loading starts, or immediately when unavailable.\n */\n load(url = this.config()?.url): Promise<void> {\n const nextUrl = url?.trim();\n if (!this.audio || !nextUrl) {\n return Promise.resolve();\n }\n\n this.loadedUrl = nextUrl;\n this.audioState.set('loading');\n this.errorMessage.set('');\n return this.audio.load(nextUrl);\n }\n\n /**\n * Plays the audio.\n *\n * @returns A promise that resolves when playback starts.\n */\n play(): Promise<void> {\n return this.audio?.play() ?? Promise.resolve();\n }\n\n /**\n * Pauses the audio.\n */\n pause(): void {\n this.audio?.pause();\n }\n\n /**\n * Retrieves the duration of the audio in seconds.\n *\n * @returns The audio duration, or `0` when unavailable.\n */\n getDuration(): number {\n return this.audio?.getDuration() ?? 0;\n }\n\n /**\n * Retrieves the underlying HTML media element.\n *\n * @returns The media element used by WaveSurfer, or `undefined` when unavailable.\n */\n getMediaElement(): HTMLMediaElement | undefined {\n return this.audio?.getMediaElement();\n }\n\n /**\n * Retrieves the current playback position in seconds.\n *\n * @returns The current time, or `0` when unavailable.\n */\n getCurrentTime(): number {\n return this.audio?.getCurrentTime() ?? this.getMediaElement()?.currentTime ?? 0;\n }\n\n /**\n * Sets the playback rate of the audio.\n *\n * @param rate - The playback rate to set.\n */\n setRate(rate: number): void {\n this.audio?.setPlaybackRate(rate);\n }\n\n /**\n * Mutes or unmutes the audio.\n *\n * @param muted - Whether the audio should be muted.\n */\n setMuted(muted: boolean): void {\n this.audio?.setMuted(muted);\n }\n\n /**\n * Indicates whether the audio is currently muted.\n *\n * @returns True when muted; otherwise false.\n */\n isMuted(): boolean {\n return this.audio?.getMuted() ?? false;\n }\n\n /**\n * @ignore\n */\n private createWaveSurfer(container: HTMLDivElement, config?: AXWaveConfig): void {\n const visualOptions = this.resolveVisualOptions(config);\n this.lastVisualKey = JSON.stringify(visualOptions);\n this.audio = WaveSurfer.create({\n container,\n ...visualOptions,\n });\n this.bindEvents();\n this.applyUrlAndRate(config);\n }\n\n /**\n * @ignore\n */\n private syncFromConfig(config?: AXWaveConfig): void {\n if (!this.audio) {\n return;\n }\n\n const visualOptions = this.resolveVisualOptions(config);\n const visualKey = JSON.stringify(visualOptions);\n if (visualKey !== this.lastVisualKey) {\n this.lastVisualKey = visualKey;\n this.audio.setOptions(visualOptions);\n }\n\n this.applyUrlAndRate(config);\n }\n\n /**\n * @ignore\n */\n private applyUrlAndRate(config?: AXWaveConfig): void {\n const url = config?.url?.trim() ?? '';\n if (url && url !== this.loadedUrl) {\n this.loadedUrl = url;\n void this.audio?.load(url);\n } else if (!url) {\n queueMicrotask(() => {\n if (!this.isDestroyed && !this.loadedUrl && this.audioState() === 'loading') {\n this.audioState.set('paused');\n }\n });\n }\n\n if (config?.audioRate != null) {\n this.audio?.setPlaybackRate(config.audioRate);\n }\n }\n\n /**\n * @ignore\n */\n private resolveVisualOptions(config?: AXWaveConfig) {\n const primary200 = this.readCssRgbVar('--ax-sys-color-primary-200');\n const primary700 = this.readCssRgbVar('--ax-sys-color-primary-700');\n\n return {\n waveColor: config?.waveColor ?? `rgba(${primary200})`,\n progressColor: config?.progressColor ?? `rgba(${primary700})`,\n barWidth: config?.barWidth ?? DEFAULT_BAR_WIDTH,\n barGap: config?.barGap ?? DEFAULT_BAR_GAP,\n barRadius: config?.barRadius ?? DEFAULT_BAR_RADIUS,\n height: config?.height ?? DEFAULT_HEIGHT,\n };\n }\n\n /**\n * @ignore\n */\n private readCssRgbVar(name: string): string {\n if (!isPlatformBrowser(this.platformId)) {\n return FALLBACK_RGB;\n }\n\n return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || FALLBACK_RGB;\n }\n\n /**\n * @ignore\n */\n private bindEvents(): void {\n if (!this.audio) {\n return;\n }\n\n this.audio.on('load', (url) => {\n this.emitStatus('load', { url }, false);\n });\n\n this.audio.on('loading', (percent) => {\n this.runInZone(() => {\n this.errorMessage.set('');\n this.audioState.set('loading');\n this.emitStatus('loading', { percent }, false, false);\n });\n });\n\n this.audio.on('decode', (duration) => {\n this.emitStatus('decode', { duration }, false);\n });\n\n this.audio.on('ready', (duration) => {\n this.runInZone(() => {\n if (this.audioState() !== 'playing') {\n this.audioState.set('ready');\n }\n this.emitStatus('ready', { duration }, false, false);\n });\n });\n\n this.audio.on('redrawcomplete', () => {\n this.emitStatus('redrawcomplete', null, false);\n });\n\n this.audio.on('play', () => {\n this.runInZone(() => {\n this.audioState.set('playing');\n this.emitStatus('play', null, false, false);\n });\n });\n\n this.audio.on('pause', () => {\n this.runInZone(() => {\n if (this.audioState() !== 'error') {\n this.audioState.set('paused');\n }\n this.emitStatus('pause', null, false, false);\n });\n });\n\n this.audio.on('finish', () => {\n this.runInZone(() => {\n this.audioState.set('paused');\n this.emitStatus('finish', null, false, false);\n });\n });\n\n this.audio.on('timeupdate', (currentTime) => {\n this.emitStatus('timeupdate', { currentTime }, false);\n });\n\n this.audio.on('seeking', (currentTime) => {\n this.emitStatus('seeking', { currentTime }, true);\n });\n\n this.audio.on('interaction', (newTime) => {\n this.emitStatus('interaction', { newTime }, true);\n });\n\n this.audio.on('click', (relativeX, relativeY) => {\n this.emitStatus('click', { relativeX, relativeY }, true);\n });\n\n this.audio.on('drag', (relativeX) => {\n this.emitStatus('drag', { relativeX }, true);\n });\n\n this.audio.on('scroll', (visibleStartTime, visibleEndTime) => {\n this.emitStatus('scroll', { visibleStartTime, visibleEndTime }, true);\n });\n\n this.audio.on('zoom', (minPxPerSec) => {\n this.emitStatus('zoom', { minPxPerSec }, false);\n });\n\n this.audio.on('destroy', () => {\n this.emitStatus('destroy', null, false);\n });\n\n this.audio.on('error', (error) => {\n this.runInZone(() => {\n const message = error?.message ?? '';\n this.errorMessage.set(message);\n this.audioState.set('error');\n this.emitStatus('error', { message }, false, false);\n });\n });\n }\n\n /**\n * @ignore\n */\n private emitStatus(\n status: AXAudioWaveStatus,\n data: AXAudioWaveEventPayload | null,\n isUserInteraction: boolean,\n wrapInZone = true,\n ): void {\n if (this.isDestroyed) {\n return;\n }\n\n const emit = () => {\n this.onStatusChanged.emit({\n component: this,\n data,\n status,\n isUserInteraction,\n });\n };\n\n if (wrapInZone) {\n this.runInZone(emit);\n return;\n }\n\n emit();\n }\n\n /**\n * @ignore\n */\n private runInZone(fn: () => void): void {\n if (this.isDestroyed) {\n return;\n }\n\n this.ngZone.run(fn);\n }\n}\n","<div class=\"ax-audio-wave-host\" [class.ax-audio-wave-host--loading]=\"audioState() === 'loading'\">\n <div class=\"ax-audio-wave\" #wave [class.ax-audio-wave--hidden]=\"!isWaveVisible()\"></div>\n\n @switch (audioState()) {\n @case ('loading') {\n <ax-skeleton class=\"ax-audio-wave-skeleton\"></ax-skeleton>\n }\n @case ('error') {\n <div class=\"ax-wave-message\">\n {{ '@acorex:error.message' | translate: { params: { message: errorMessage() } } | async }}\n </div>\n }\n }\n</div>\n","import { NgModule } from '@angular/core';\nimport { AXAudioWaveComponent } from './audio-wave.component';\n\n@NgModule({\n exports: [AXAudioWaveComponent],\n imports: [AXAudioWaveComponent],\n})\nexport class AXAudioWaveModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AA6BA,MAAM,iBAAiB,GAAG,CAAC;AAC3B,MAAM,eAAe,GAAG,CAAC;AACzB,MAAM,kBAAkB,GAAG,CAAC;AAC5B,MAAM,cAAc,GAAG,EAAE;AACzB,MAAM,YAAY,GAAG,eAAe;AAEpC;;;;AAIG;MAcU,oBAAoB,CAAA;AAuE/B;;AAEG;AACH,IAAA,WAAA,GAAA;AAzEA;;AAEG;QACc,IAAA,CAAA,IAAI,GAAG,SAAS,CAA6B,MAAM;iFAAC;AAErE;;AAEG;AACM,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK;8FAAgB;AAEvC;;;;AAIG;QACM,IAAA,CAAA,eAAe,GAAG,MAAM,EAA0B;AAE3D;;AAEG;QACgB,IAAA,CAAA,UAAU,GAAG,MAAM,CAAmB,SAAS;uFAAC;AAEnE;;AAEG;QACgB,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,EAAE;yFAAC;AAE5C;;AAEG;AACgB,QAAA,IAAA,CAAA,aAAa,GAAG,QAAQ,CAAC,MAAK;AAC/C,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE;YAC/B,OAAO,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,K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AA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,iBAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;MElDzD,iBAAiB,CAAA;8GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAjB,iBAAiB,EAAA,OAAA,EAAA,CAFlB,oBAAoB,CAAA,EAAA,OAAA,EAAA,CADpB,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAGnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAFlB,oBAAoB,CAAA,EAAA,CAAA,CAAA;;2FAEnB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAChC,iBAAA;;;ACND;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex/components",
|
|
3
|
-
"version": "22.1.
|
|
3
|
+
"version": "22.1.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@acorex/core": "22.1.
|
|
6
|
-
"@acorex/cdk": "22.1.
|
|
5
|
+
"@acorex/core": "22.1.3",
|
|
6
|
+
"@acorex/cdk": "22.1.3",
|
|
7
7
|
"@angular/aria": ">=22.1.0",
|
|
8
8
|
"polytype": ">=0.17.0",
|
|
9
9
|
"angular-imask": ">=7.6.1",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"@editorjs/raw": ">=2.5.1",
|
|
43
43
|
"@editorjs/image": ">=2.10.3",
|
|
44
44
|
"@editorjs/underline": ">=1.2.1",
|
|
45
|
-
"editorjs-text-color-plugin": ">=2.0.3"
|
|
45
|
+
"editorjs-text-color-plugin": ">=2.0.3",
|
|
46
|
+
"wavesurfer.js": ">=7.7.15"
|
|
46
47
|
},
|
|
47
48
|
"peerDependenciesMeta": {},
|
|
48
49
|
"dependencies": {
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { OnDestroy, ElementRef, InputSignal } from '@angular/core';
|
|
3
|
-
import WaveSurfer from 'wavesurfer.js';
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
4
2
|
import { AXEvent } from '@acorex/cdk/common';
|
|
5
|
-
import * as i1 from '@angular/common';
|
|
6
|
-
import * as i2 from '@acorex/components/button';
|
|
7
|
-
import * as i3 from '@acorex/components/decorators';
|
|
8
|
-
import * as i4 from '@acorex/components/skeleton';
|
|
9
|
-
import * as i5 from '@acorex/core/translation';
|
|
10
3
|
|
|
4
|
+
type AXAudioWaveStatus = 'load' | 'loading' | 'decode' | 'ready' | 'redrawcomplete' | 'play' | 'pause' | 'finish' | 'timeupdate' | 'seeking' | 'interaction' | 'click' | 'drag' | 'scroll' | 'zoom' | 'destroy' | 'error';
|
|
5
|
+
type AXAudioWaveState = 'playing' | 'paused' | 'loading' | 'ready' | 'error';
|
|
11
6
|
interface AXWaveConfig {
|
|
12
|
-
container?: HTMLElement;
|
|
13
7
|
waveColor?: string;
|
|
14
8
|
progressColor?: string;
|
|
15
9
|
url: string;
|
|
@@ -19,9 +13,22 @@ interface AXWaveConfig {
|
|
|
19
13
|
height?: number;
|
|
20
14
|
audioRate?: number;
|
|
21
15
|
}
|
|
16
|
+
interface AXAudioWaveEventPayload {
|
|
17
|
+
url?: string;
|
|
18
|
+
percent?: number;
|
|
19
|
+
duration?: number;
|
|
20
|
+
currentTime?: number;
|
|
21
|
+
newTime?: number;
|
|
22
|
+
relativeX?: number;
|
|
23
|
+
relativeY?: number;
|
|
24
|
+
visibleStartTime?: number;
|
|
25
|
+
visibleEndTime?: number;
|
|
26
|
+
minPxPerSec?: number;
|
|
27
|
+
message?: string;
|
|
28
|
+
}
|
|
22
29
|
interface AXAudioWaveChangeEvent extends AXEvent {
|
|
23
|
-
status:
|
|
24
|
-
data:
|
|
30
|
+
status: AXAudioWaveStatus;
|
|
31
|
+
data: AXAudioWaveEventPayload | null;
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
/**
|
|
@@ -29,61 +36,99 @@ interface AXAudioWaveChangeEvent extends AXEvent {
|
|
|
29
36
|
*
|
|
30
37
|
* @category Components
|
|
31
38
|
*/
|
|
32
|
-
declare class AXAudioWaveComponent
|
|
39
|
+
declare class AXAudioWaveComponent {
|
|
33
40
|
/**
|
|
34
|
-
*
|
|
41
|
+
* @ignore
|
|
35
42
|
*/
|
|
36
|
-
|
|
43
|
+
private readonly wave;
|
|
37
44
|
/**
|
|
38
45
|
* Configuration settings for the audio wave.
|
|
39
46
|
*/
|
|
40
|
-
config: InputSignal<AXWaveConfig>;
|
|
47
|
+
readonly config: _angular_core.InputSignal<AXWaveConfig>;
|
|
41
48
|
/**
|
|
42
49
|
* Emits an event when the status of the audio wave changes.
|
|
43
50
|
*
|
|
44
51
|
* @event
|
|
45
52
|
*/
|
|
46
|
-
onStatusChanged:
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
readonly onStatusChanged: _angular_core.OutputEmitterRef<AXAudioWaveChangeEvent>;
|
|
54
|
+
/**
|
|
55
|
+
* @ignore
|
|
56
|
+
*/
|
|
57
|
+
protected readonly audioState: _angular_core.WritableSignal<AXAudioWaveState>;
|
|
58
|
+
/**
|
|
59
|
+
* @ignore
|
|
60
|
+
*/
|
|
61
|
+
protected readonly errorMessage: _angular_core.WritableSignal<string>;
|
|
62
|
+
/**
|
|
63
|
+
* @ignore
|
|
64
|
+
*/
|
|
65
|
+
protected readonly isWaveVisible: _angular_core.Signal<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* @ignore
|
|
68
|
+
*/
|
|
69
|
+
private audio;
|
|
70
|
+
/**
|
|
71
|
+
* @ignore
|
|
72
|
+
*/
|
|
73
|
+
private loadedUrl;
|
|
49
74
|
/**
|
|
50
|
-
*
|
|
75
|
+
* @ignore
|
|
51
76
|
*/
|
|
52
|
-
|
|
77
|
+
private lastVisualKey;
|
|
53
78
|
/**
|
|
54
|
-
*
|
|
79
|
+
* @ignore
|
|
55
80
|
*/
|
|
56
|
-
private
|
|
57
|
-
private platformID;
|
|
81
|
+
private isDestroyed;
|
|
58
82
|
/**
|
|
59
|
-
*
|
|
83
|
+
* @ignore
|
|
84
|
+
*/
|
|
85
|
+
private readonly ngZone;
|
|
86
|
+
/**
|
|
87
|
+
* @ignore
|
|
88
|
+
*/
|
|
89
|
+
private readonly platformId;
|
|
90
|
+
/**
|
|
91
|
+
* @ignore
|
|
92
|
+
*/
|
|
93
|
+
private readonly destroyRef;
|
|
94
|
+
/**
|
|
95
|
+
* @ignore
|
|
60
96
|
*/
|
|
61
97
|
constructor();
|
|
62
98
|
/**
|
|
63
99
|
* Loads the audio from the specified URL.
|
|
64
100
|
*
|
|
65
101
|
* @param url - The URL of the audio to load. Defaults to the URL from the config.
|
|
102
|
+
* @returns A promise that resolves when loading starts, or immediately when unavailable.
|
|
66
103
|
*/
|
|
67
|
-
load(url?: string): void
|
|
104
|
+
load(url?: string): Promise<void>;
|
|
68
105
|
/**
|
|
69
106
|
* Plays the audio.
|
|
70
107
|
*
|
|
108
|
+
* @returns A promise that resolves when playback starts.
|
|
71
109
|
*/
|
|
72
|
-
play(): Promise<
|
|
110
|
+
play(): Promise<void>;
|
|
73
111
|
/**
|
|
74
112
|
* Pauses the audio.
|
|
75
113
|
*/
|
|
76
114
|
pause(): void;
|
|
77
115
|
/**
|
|
78
|
-
* Retrieves the duration of the audio.
|
|
116
|
+
* Retrieves the duration of the audio in seconds.
|
|
79
117
|
*
|
|
118
|
+
* @returns The audio duration, or `0` when unavailable.
|
|
80
119
|
*/
|
|
81
120
|
getDuration(): number;
|
|
82
121
|
/**
|
|
83
|
-
* Retrieves the media element
|
|
122
|
+
* Retrieves the underlying HTML media element.
|
|
84
123
|
*
|
|
124
|
+
* @returns The media element used by WaveSurfer, or `undefined` when unavailable.
|
|
125
|
+
*/
|
|
126
|
+
getMediaElement(): HTMLMediaElement | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Retrieves the current playback position in seconds.
|
|
129
|
+
*
|
|
130
|
+
* @returns The current time, or `0` when unavailable.
|
|
85
131
|
*/
|
|
86
|
-
getMediaElement(): HTMLMediaElement;
|
|
87
132
|
getCurrentTime(): number;
|
|
88
133
|
/**
|
|
89
134
|
* Sets the playback rate of the audio.
|
|
@@ -91,56 +136,59 @@ declare class AXAudioWaveComponent implements OnDestroy {
|
|
|
91
136
|
* @param rate - The playback rate to set.
|
|
92
137
|
*/
|
|
93
138
|
setRate(rate: number): void;
|
|
139
|
+
/**
|
|
140
|
+
* Mutes or unmutes the audio.
|
|
141
|
+
*
|
|
142
|
+
* @param muted - Whether the audio should be muted.
|
|
143
|
+
*/
|
|
94
144
|
setMuted(muted: boolean): void;
|
|
145
|
+
/**
|
|
146
|
+
* Indicates whether the audio is currently muted.
|
|
147
|
+
*
|
|
148
|
+
* @returns True when muted; otherwise false.
|
|
149
|
+
*/
|
|
95
150
|
isMuted(): boolean;
|
|
96
151
|
/**
|
|
97
|
-
*
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
/** Just before the waveform is destroyed so you can clean up your events */
|
|
131
|
-
protected handleDestroy(): void;
|
|
132
|
-
/** Just before the waveform is destroyed so you can clean up your events */
|
|
133
|
-
protected handleError(): void;
|
|
134
|
-
ngOnDestroy(): void;
|
|
135
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXAudioWaveComponent, never>;
|
|
136
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AXAudioWaveComponent, "ax-audio-wave", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; }, { "onStatusChanged": "onStatusChanged"; }, never, never, true, never>;
|
|
152
|
+
* @ignore
|
|
153
|
+
*/
|
|
154
|
+
private createWaveSurfer;
|
|
155
|
+
/**
|
|
156
|
+
* @ignore
|
|
157
|
+
*/
|
|
158
|
+
private syncFromConfig;
|
|
159
|
+
/**
|
|
160
|
+
* @ignore
|
|
161
|
+
*/
|
|
162
|
+
private applyUrlAndRate;
|
|
163
|
+
/**
|
|
164
|
+
* @ignore
|
|
165
|
+
*/
|
|
166
|
+
private resolveVisualOptions;
|
|
167
|
+
/**
|
|
168
|
+
* @ignore
|
|
169
|
+
*/
|
|
170
|
+
private readCssRgbVar;
|
|
171
|
+
/**
|
|
172
|
+
* @ignore
|
|
173
|
+
*/
|
|
174
|
+
private bindEvents;
|
|
175
|
+
/**
|
|
176
|
+
* @ignore
|
|
177
|
+
*/
|
|
178
|
+
private emitStatus;
|
|
179
|
+
/**
|
|
180
|
+
* @ignore
|
|
181
|
+
*/
|
|
182
|
+
private runInZone;
|
|
183
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXAudioWaveComponent, never>;
|
|
184
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXAudioWaveComponent, "ax-audio-wave", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; }, { "onStatusChanged": "onStatusChanged"; }, never, never, true, never>;
|
|
137
185
|
}
|
|
138
186
|
|
|
139
187
|
declare class AXAudioWaveModule {
|
|
140
|
-
static ɵfac:
|
|
141
|
-
static ɵmod:
|
|
142
|
-
static ɵinj:
|
|
188
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXAudioWaveModule, never>;
|
|
189
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXAudioWaveModule, never, [typeof AXAudioWaveComponent], [typeof AXAudioWaveComponent]>;
|
|
190
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXAudioWaveModule>;
|
|
143
191
|
}
|
|
144
192
|
|
|
145
193
|
export { AXAudioWaveComponent, AXAudioWaveModule };
|
|
146
|
-
export type { AXAudioWaveChangeEvent, AXWaveConfig };
|
|
194
|
+
export type { AXAudioWaveChangeEvent, AXAudioWaveEventPayload, AXAudioWaveState, AXAudioWaveStatus, AXWaveConfig };
|