@scalemule/nextjs 0.1.42 → 0.1.43

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/dist/audio.d.mts CHANGED
@@ -17,7 +17,11 @@ interface AudioPlayerProps {
17
17
  label?: string;
18
18
  className?: string;
19
19
  style?: CSSProperties;
20
- /** Defaults to none: lists do not download every recording on page load. */
20
+ /**
21
+ * Defaults to none so a list does not download every recording.
22
+ * A player that does not already know its length uses metadata anyway,
23
+ * so the clock can show before play.
24
+ */
21
25
  preload?: 'none' | 'metadata';
22
26
  /** Called at most once automatically per play attempt. Honor signal to cancel network work. */
23
27
  onRefresh?: (signal: AbortSignal) => Promise<AudioPlayerSource>;
package/dist/audio.d.ts CHANGED
@@ -17,7 +17,11 @@ interface AudioPlayerProps {
17
17
  label?: string;
18
18
  className?: string;
19
19
  style?: CSSProperties;
20
- /** Defaults to none: lists do not download every recording on page load. */
20
+ /**
21
+ * Defaults to none so a list does not download every recording.
22
+ * A player that does not already know its length uses metadata anyway,
23
+ * so the clock can show before play.
24
+ */
21
25
  preload?: 'none' | 'metadata';
22
26
  /** Called at most once automatically per play attempt. Honor signal to cancel network work. */
23
27
  onRefresh?: (signal: AbortSignal) => Promise<AudioPlayerSource>;
package/dist/audio.js CHANGED
@@ -225,6 +225,7 @@ function PlayerSession({
225
225
  return Number.isFinite(value) ? Math.min(1, Math.max(0.08, Math.abs(value))) : 0.08;
226
226
  });
227
227
  }, [source.waveform_peaks]);
228
+ const mediaPreload = durationOf(source) > 0 ? preload : "metadata";
228
229
  const current = Math.min(positive(position), duration || Infinity);
229
230
  const progress = duration ? Math.max(0, Math.min(100, current / duration * 100)) : 0;
230
231
  const remaining = duration ? `${time((duration - current) / speed)} remaining` : "Duration available when played";
@@ -243,7 +244,7 @@ function PlayerSession({
243
244
  {
244
245
  ref: media,
245
246
  src: source.url ?? void 0,
246
- preload,
247
+ preload: mediaPreload,
247
248
  onLoadedMetadata: (e) => {
248
249
  const element = e.currentTarget;
249
250
  const total = positive(element.duration) || durationOf(source);
package/dist/audio.mjs CHANGED
@@ -206,6 +206,7 @@ function PlayerSession({
206
206
  return Number.isFinite(value) ? Math.min(1, Math.max(0.08, Math.abs(value))) : 0.08;
207
207
  });
208
208
  }, [source.waveform_peaks]);
209
+ const mediaPreload = durationOf(source) > 0 ? preload : "metadata";
209
210
  const current = Math.min(positive(position), duration || Infinity);
210
211
  const progress = duration ? Math.max(0, Math.min(100, current / duration * 100)) : 0;
211
212
  const remaining = duration ? `${time((duration - current) / speed)} remaining` : "Duration available when played";
@@ -224,7 +225,7 @@ function PlayerSession({
224
225
  {
225
226
  ref: media,
226
227
  src: source.url ?? void 0,
227
- preload,
228
+ preload: mediaPreload,
228
229
  onLoadedMetadata: (e) => {
229
230
  const element = e.currentTarget;
230
231
  const total = positive(element.duration) || durationOf(source);
@@ -516,7 +516,7 @@ declare class ScaleMuleError extends Error {
516
516
  * through the route handler to the platform service.
517
517
  */
518
518
  readonly requestId?: string | undefined;
519
- constructor(code: string, message: string, status?: number, details?: Record<string, unknown> | undefined,
519
+ constructor(code: string, message: string, status?: number, details?: Record<string, unknown> | undefined,
520
520
  /**
521
521
  * Correlation id of the upstream platform request that produced this
522
522
  * error, when there was one. `apiHandler()` echoes it back to the browser
@@ -516,7 +516,7 @@ declare class ScaleMuleError extends Error {
516
516
  * through the route handler to the platform service.
517
517
  */
518
518
  readonly requestId?: string | undefined;
519
- constructor(code: string, message: string, status?: number, details?: Record<string, unknown> | undefined,
519
+ constructor(code: string, message: string, status?: number, details?: Record<string, unknown> | undefined,
520
520
  /**
521
521
  * Correlation id of the upstream platform request that produced this
522
522
  * error, when there was one. `apiHandler()` echoes it back to the browser
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/nextjs",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "ScaleMule SDK for Next.js applications - authentication, storage, and user management",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",