@gentomiyano/optimized-web-audio-player 0.2.1 → 0.2.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.
- package/README.md +27 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/consumer/index.d.ts +1 -1
- package/dist/contracts/index.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/media-delivery/index.d.ts +1 -1
- package/dist/{media-element-DyMO-PhK.d.ts → media-element-vFtmw4mQ.d.ts} +1 -1
- package/dist/{player-BxNFzRq4.d.ts → player-CE714iU_.d.ts} +2 -1
- package/dist/ports/index.d.ts +2 -2
- package/dist/react/index.d.ts +6 -3
- package/dist/react/index.js +390 -182
- package/dist/react/index.js.map +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/ui/index.d.ts +3 -2
- package/dist/ui/index.js +152 -108
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/player-views.css +37 -59
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,6 +39,33 @@ The public npm registry, scoped package name, and release workflow are fixed.
|
|
|
39
39
|
Initial npm publication still requires the scope owner's authentication.
|
|
40
40
|
Release and consumer pinning rules are documented in `docs/RELEASING.md`.
|
|
41
41
|
|
|
42
|
+
## PLAYER-UI-CONTRACT-01 Bound Compact
|
|
43
|
+
|
|
44
|
+
Version 0.2.3 makes the occurrence-bound inline Player use the standard
|
|
45
|
+
Compact visual implementation. `CompactPlayer` and `BoundCompactPlayerView`
|
|
46
|
+
now share one surface, metadata grid, waveform signal, seek overlay, tokens,
|
|
47
|
+
and container-query behavior; the former `player-bound-compact` surface and
|
|
48
|
+
its separate active panel are removed.
|
|
49
|
+
|
|
50
|
+
The React API and playback semantics are unchanged. An inactive occurrence
|
|
51
|
+
shows its own metadata at zero and activates its context only on Play. The
|
|
52
|
+
active occurrence exposes global Play / Pause, time, and seek while the
|
|
53
|
+
existing Global Mini continues to use the same Store and audio element. See
|
|
54
|
+
`docs/PLAYER-UI-CONTRACT-01-BOUND-COMPACT.md`.
|
|
55
|
+
|
|
56
|
+
## WP-04.4 SSR-transparent Provider
|
|
57
|
+
|
|
58
|
+
Version 0.2.2 renders consumer children inside the same Player Context from
|
|
59
|
+
server rendering through hydration and Runtime readiness. `usePlayer()`
|
|
60
|
+
exposes `runtimeStatus` as `pending` or `ready`; pending state uses an inert,
|
|
61
|
+
SSR-safe Store bridge and never creates browser audio infrastructure.
|
|
62
|
+
|
|
63
|
+
`BoundCompactPlayer` renders its occurrence metadata while pending. Runtime
|
|
64
|
+
attachment updates the shared external Store without replacing or remounting
|
|
65
|
+
the consumer subtree. The built-package smoke now performs server rendering,
|
|
66
|
+
hydration, duplicate-ID, stable-sentinel, shared Mini Player, and single-audio
|
|
67
|
+
checks. See `docs/WP-04.4-SSR-TRANSPARENT-PROVIDER.md`.
|
|
68
|
+
|
|
42
69
|
## WP-04.3 React package boundary
|
|
43
70
|
|
|
44
71
|
Version 0.2.1 keeps React Context consumers in the `/react` entrypoint and
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as PlayerExperienceConfig,
|
|
1
|
+
import { p as PlayerExperienceConfig, z as PlayerState } from '../player-CE714iU_.js';
|
|
2
2
|
import { PlayerExperienceConfigValidationResult } from '../contracts/index.js';
|
|
3
3
|
|
|
4
4
|
declare const PLAYER_EXPERIENCE_CONFIG_SCHEMA_VERSION: 2;
|
package/dist/consumer/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Q as QueueItem, u as PlayerMediaAdapter } from '../player-
|
|
1
|
+
import { Q as QueueItem, u as PlayerMediaAdapter } from '../player-CE714iU_.js';
|
|
2
2
|
|
|
3
3
|
interface PlayerQueueCandidate<TSource> {
|
|
4
4
|
/** Host-owned stable identity for this occurrence in a queue context. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as PlayerExperienceConfig } from '../player-
|
|
2
|
-
export { A as ActivatePlaybackContextOptions, B as BoundPlayerCommands, a as BoundPlayerViewState, F as FadeCurve, M as MediaKind, P as PauseOptions, b as PersistMode, c as PlaybackContextInput, d as PlaybackContextMode, e as PlaybackContextState, f as PlaybackStatus, g as PlaybackTransitionCause, h as PlayerAppearance, i as PlayerCommandResult, j as PlayerCommands, k as PlayerConfigImportResult, l as PlayerDebugController, m as PlayerDebugSnapshot, n as PlayerError, o as PlayerErrorCode, q as PlayerExperienceConfigEnvelope, r as PlayerExperienceConfigStore, s as PlayerExperiencePreset, t as PlayerHostConfig, u as PlayerMediaAdapter, v as PlayerMediaItem, w as PlayerMediaSource, x as PlayerMediaSyncReason, y as
|
|
1
|
+
import { p as PlayerExperienceConfig } from '../player-CE714iU_.js';
|
|
2
|
+
export { A as ActivatePlaybackContextOptions, B as BoundPlayerCommands, a as BoundPlayerViewState, F as FadeCurve, M as MediaKind, P as PauseOptions, b as PersistMode, c as PlaybackContextInput, d as PlaybackContextMode, e as PlaybackContextState, f as PlaybackStatus, g as PlaybackTransitionCause, h as PlayerAppearance, i as PlayerCommandResult, j as PlayerCommands, k as PlayerConfigImportResult, l as PlayerDebugController, m as PlayerDebugSnapshot, n as PlayerError, o as PlayerErrorCode, q as PlayerExperienceConfigEnvelope, r as PlayerExperienceConfigStore, s as PlayerExperiencePreset, t as PlayerHostConfig, u as PlayerMediaAdapter, v as PlayerMediaItem, w as PlayerMediaSource, x as PlayerMediaSyncReason, y as PlayerRuntimeStatus, z as PlayerState, C as PlayerStore, D as PlayerViewProps, E as PlayerWaveform, G as PodcastPreviousMode, Q as QueueItem, R as RepeatMode, S as SeekCommitMode, H as SetQueueOptions, I as StopOptions } from '../player-CE714iU_.js';
|
|
3
3
|
|
|
4
4
|
interface ConfigValidationSuccess {
|
|
5
5
|
readonly ok: true;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ConfigValidationFailure, ConfigValidationSuccess, PlayerExperienceConfigValidationResult } from './contracts/index.js';
|
|
2
|
-
export { A as ActivatePlaybackContextOptions, B as BoundPlayerCommands, a as BoundPlayerViewState, F as FadeCurve, M as MediaKind, P as PauseOptions, b as PersistMode, c as PlaybackContextInput, d as PlaybackContextMode, e as PlaybackContextState, f as PlaybackStatus, g as PlaybackTransitionCause, h as PlayerAppearance, i as PlayerCommandResult, j as PlayerCommands, k as PlayerConfigImportResult, l as PlayerDebugController, m as PlayerDebugSnapshot, n as PlayerError, o as PlayerErrorCode, p as PlayerExperienceConfig, q as PlayerExperienceConfigEnvelope, r as PlayerExperienceConfigStore, s as PlayerExperiencePreset, t as PlayerHostConfig, u as PlayerMediaAdapter, v as PlayerMediaItem, w as PlayerMediaSource, x as PlayerMediaSyncReason, y as
|
|
2
|
+
export { A as ActivatePlaybackContextOptions, B as BoundPlayerCommands, a as BoundPlayerViewState, F as FadeCurve, M as MediaKind, P as PauseOptions, b as PersistMode, c as PlaybackContextInput, d as PlaybackContextMode, e as PlaybackContextState, f as PlaybackStatus, g as PlaybackTransitionCause, h as PlayerAppearance, i as PlayerCommandResult, j as PlayerCommands, k as PlayerConfigImportResult, l as PlayerDebugController, m as PlayerDebugSnapshot, n as PlayerError, o as PlayerErrorCode, p as PlayerExperienceConfig, q as PlayerExperienceConfigEnvelope, r as PlayerExperienceConfigStore, s as PlayerExperiencePreset, t as PlayerHostConfig, u as PlayerMediaAdapter, v as PlayerMediaItem, w as PlayerMediaSource, x as PlayerMediaSyncReason, y as PlayerRuntimeStatus, z as PlayerState, C as PlayerStore, D as PlayerViewProps, E as PlayerWaveform, G as PodcastPreviousMode, Q as QueueItem, R as RepeatMode, S as SeekCommitMode, H as SetQueueOptions, I as StopOptions } from './player-CE714iU_.js';
|
|
3
3
|
export { PLAYER_EXPERIENCE_CONFIG_LIMITS, PLAYER_EXPERIENCE_CONFIG_SCHEMA_VERSION, PREVIEW_PLAYER_EXPERIENCE_CONFIG, createInitialPlayerState, parsePlayerExperienceConfigJson, resolvePlayerExperienceConfig, serializePlayerExperienceConfig, validatePlayerExperienceConfig, validatePlayerExperienceConfigOverride } from './config/index.js';
|
|
4
4
|
export { AudioSampleEncoding, FutureUploadFormat, MEDIA_DELIVERY_CONTRACT_VERSION, MediaAccessClass, MediaDeliveryDescriptor, MediaDeliverySourceReference, MediaLoudnessMetadata, MediaSourceRole, MediaStorageReferences, MediaUploadEvidence, MediaUploadValidationResult, NormalizedUploadIdentity, PlaybackSourceResolveErrorCode, PlaybackSourceResolveReason, PlaybackSourceResolveRequest, PlaybackSourceResolveResult, PlayerDeliveryHostAdapter, PlayerMediaDescriptor, ProcessedMediaMetadata, ResolvedPlaybackSource, SupportedUploadFormat, UploadHeaderFormat, UploadValidationError, UploadValidationErrorCode, WaveformPeaksV1, validateMediaUploadEvidence, validateWaveformPeaks } from './media-delivery/index.js';
|
|
5
5
|
export { GainPort, GainTransition, PlayerPersistencePort, PodcastProgress, PodcastProgressPort } from './ports/index.js';
|
|
6
|
-
export { M as MediaElementPort, a as MediaElementStateSnapshot, P as PlayerMediaEvent, b as PlayerMediaEventListener, c as PlayerMediaEventType } from './media-element-
|
|
6
|
+
export { M as MediaElementPort, a as MediaElementStateSnapshot, P as PlayerMediaEvent, b as PlayerMediaEventListener, c as PlayerMediaEventType } from './media-element-vFtmw4mQ.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { w as PlayerMediaSource, v as PlayerMediaItem } from '../player-
|
|
1
|
+
import { w as PlayerMediaSource, v as PlayerMediaItem } from '../player-CE714iU_.js';
|
|
2
2
|
|
|
3
3
|
declare const MEDIA_DELIVERY_CONTRACT_VERSION: 1;
|
|
4
4
|
type SupportedUploadFormat = "wav" | "mp3";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as PlayerError, w as PlayerMediaSource } from './player-
|
|
1
|
+
import { n as PlayerError, w as PlayerMediaSource } from './player-CE714iU_.js';
|
|
2
2
|
|
|
3
3
|
type PlayerMediaEventType = "loadstart" | "loadedmetadata" | "canplay" | "play" | "playing" | "pause" | "waiting" | "stalled" | "seeking" | "seeked" | "timeupdate" | "ended" | "error" | "durationchange" | "volumechange";
|
|
4
4
|
interface PlayerMediaEvent {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type PlaybackStatus = "idle" | "loading" | "playing" | "paused" | "seeking" | "ended" | "error";
|
|
2
|
+
type PlayerRuntimeStatus = "pending" | "ready";
|
|
2
3
|
type PlaybackTransitionCause = "user-play" | "user-pause" | "user-stop" | "natural-end" | "os-interruption" | "background-suspension" | "autoplay-blocked" | "source-error";
|
|
3
4
|
type PlayerMediaSyncReason = "visibilitychange" | "pageshow" | "focus" | "audio-context-statechange" | "manual";
|
|
4
5
|
type RepeatMode = "off" | "all" | "one";
|
|
@@ -261,4 +262,4 @@ interface PlayerDebugController {
|
|
|
261
262
|
exportProductionConfigJson(): string;
|
|
262
263
|
}
|
|
263
264
|
|
|
264
|
-
export type { ActivatePlaybackContextOptions as A, BoundPlayerCommands as B,
|
|
265
|
+
export type { ActivatePlaybackContextOptions as A, BoundPlayerCommands as B, PlayerStore as C, PlayerViewProps as D, PlayerWaveform as E, FadeCurve as F, PodcastPreviousMode as G, SetQueueOptions as H, StopOptions as I, MediaKind as M, PauseOptions as P, QueueItem as Q, RepeatMode as R, SeekCommitMode as S, BoundPlayerViewState as a, PersistMode as b, PlaybackContextInput as c, PlaybackContextMode as d, PlaybackContextState as e, PlaybackStatus as f, PlaybackTransitionCause as g, PlayerAppearance as h, PlayerCommandResult as i, PlayerCommands as j, PlayerConfigImportResult as k, PlayerDebugController as l, PlayerDebugSnapshot as m, PlayerError as n, PlayerErrorCode as o, PlayerExperienceConfig as p, PlayerExperienceConfigEnvelope as q, PlayerExperienceConfigStore as r, PlayerExperiencePreset as s, PlayerHostConfig as t, PlayerMediaAdapter as u, PlayerMediaItem as v, PlayerMediaSource as w, PlayerMediaSyncReason as x, PlayerRuntimeStatus as y, PlayerState as z };
|
package/dist/ports/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FadeCurve } from '../player-
|
|
2
|
-
export { M as MediaElementPort, a as MediaElementStateSnapshot, P as PlayerMediaEvent, b as PlayerMediaEventListener, c as PlayerMediaEventType } from '../media-element-
|
|
1
|
+
import { F as FadeCurve } from '../player-CE714iU_.js';
|
|
2
|
+
export { M as MediaElementPort, a as MediaElementStateSnapshot, P as PlayerMediaEvent, b as PlayerMediaEventListener, c as PlayerMediaEventType } from '../media-element-vFtmw4mQ.js';
|
|
3
3
|
|
|
4
4
|
interface GainTransition {
|
|
5
5
|
readonly durationMs: number;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { j as PlayerCommands, x as PlayerMediaSyncReason, Q as QueueItem, p as PlayerExperienceConfig,
|
|
4
|
-
import { c as PlayerMediaEventType, a as MediaElementStateSnapshot } from '../media-element-
|
|
3
|
+
import { j as PlayerCommands, x as PlayerMediaSyncReason, Q as QueueItem, p as PlayerExperienceConfig, y as PlayerRuntimeStatus, C as PlayerStore, r as PlayerExperienceConfigStore, z as PlayerState, c as PlaybackContextInput, a as BoundPlayerViewState, B as BoundPlayerCommands, h as PlayerAppearance } from '../player-CE714iU_.js';
|
|
4
|
+
import { c as PlayerMediaEventType, a as MediaElementStateSnapshot } from '../media-element-vFtmw4mQ.js';
|
|
5
5
|
|
|
6
6
|
type PlayerAudioMode = "auto" | "web-audio" | "html-media";
|
|
7
7
|
type ResolvedPlayerAudioMode = "web-audio" | "html-media";
|
|
@@ -44,6 +44,7 @@ interface PlayerProviderProps {
|
|
|
44
44
|
readonly initialQueue?: readonly QueueItem[];
|
|
45
45
|
readonly initialQueueItemId?: string;
|
|
46
46
|
readonly experienceConfig?: Partial<PlayerExperienceConfig>;
|
|
47
|
+
/** Used only when children is null or undefined while Runtime is pending. */
|
|
47
48
|
readonly loadingFallback?: ReactNode;
|
|
48
49
|
/**
|
|
49
50
|
* auto uses native HTML audio on iOS/iPadOS and Web Audio elsewhere.
|
|
@@ -54,6 +55,7 @@ interface PlayerProviderProps {
|
|
|
54
55
|
readonly onDiagnosticEvent?: PlayerRuntimeDiagnosticListener;
|
|
55
56
|
}
|
|
56
57
|
interface PlayerRuntimeContextValue {
|
|
58
|
+
readonly runtimeStatus: PlayerRuntimeStatus;
|
|
57
59
|
readonly store: PlayerStore;
|
|
58
60
|
readonly commands: PlayerCommands;
|
|
59
61
|
readonly experience: PlayerExperienceConfigStore;
|
|
@@ -73,6 +75,7 @@ interface MiniPlayerHostProps {
|
|
|
73
75
|
declare function MiniPlayerHost({ children, className, onInsetChange, visible, }: MiniPlayerHostProps): react.JSX.Element | null;
|
|
74
76
|
|
|
75
77
|
interface UsePlayerResult {
|
|
78
|
+
readonly runtimeStatus: PlayerRuntimeStatus;
|
|
76
79
|
readonly state: Readonly<PlayerState>;
|
|
77
80
|
readonly commands: PlayerCommands;
|
|
78
81
|
readonly experience: PlayerExperienceConfigStore;
|
|
@@ -102,4 +105,4 @@ interface BoundCompactPlayerProps {
|
|
|
102
105
|
}
|
|
103
106
|
declare function BoundCompactPlayer({ appearance, className, context, queueItem, }: BoundCompactPlayerProps): react.JSX.Element;
|
|
104
107
|
|
|
105
|
-
export { BoundCompactPlayer, type BoundCompactPlayerProps, MiniPlayerHost, type MiniPlayerHostProps, PlayerProvider, type PlayerProviderProps, type PlayerRuntimeContextValue, type PlayerRuntimeDiagnosticEvent, type PlayerRuntimeDiagnosticListener, type PlayerRuntimeDiagnosticPayload, type UseBoundPlayerOptions, type UseBoundPlayerResult, type UsePlayerResult, deriveBoundPlayerViewState, useBoundPlayer, usePlayer };
|
|
108
|
+
export { BoundCompactPlayer, type BoundCompactPlayerProps, MiniPlayerHost, type MiniPlayerHostProps, PlayerProvider, type PlayerProviderProps, type PlayerRuntimeContextValue, type PlayerRuntimeDiagnosticEvent, type PlayerRuntimeDiagnosticListener, type PlayerRuntimeDiagnosticPayload, PlayerRuntimeStatus, type UseBoundPlayerOptions, type UseBoundPlayerResult, type UsePlayerResult, deriveBoundPlayerViewState, useBoundPlayer, usePlayer };
|