strata-react 2.1.0 → 2.1.1
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 +1 -1
- package/UPGRADING.md +4 -0
- package/dist/hls.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +189 -26
- package/dist/index.js.map +1 -1
- package/dist/{media-player-BETa3P7K.d.ts → media-player-Buvu2l7R.d.ts} +20 -6
- package/package.json +1 -1
|
@@ -370,11 +370,13 @@ type VolumeControlProps = {
|
|
|
370
370
|
onVolumeChange: (volume: number) => void;
|
|
371
371
|
/** Allow over 100 (a boost), up to this. Default 100. */
|
|
372
372
|
max?: number;
|
|
373
|
+
/** Allow over 100, up to this, behind a Louder toggle: the slider stops at 100 until it is pressed, so a slip of the thumb or the wheel never doubles the sound. Turning it off brings the volume back to 100. Takes the place of `max`. */
|
|
374
|
+
boost?: number;
|
|
373
375
|
disabled?: boolean;
|
|
374
376
|
className?: string;
|
|
375
377
|
};
|
|
376
|
-
/** A mute button and a volume slider with its value in percent. Muting sets the volume to 0 and remembers the level; unmuting puts it back. Moving the slider from 0 unmutes. */
|
|
377
|
-
declare function VolumeControl({ volume, onVolumeChange, max, disabled, className }: VolumeControlProps): React.JSX.Element;
|
|
378
|
+
/** A mute button and a volume slider with its value in percent. Muting sets the volume to 0 and remembers the level; unmuting puts it back. Moving the slider from 0 unmutes. With `boost`, a Louder toggle lets it past 100. */
|
|
379
|
+
declare function VolumeControl({ volume, onVolumeChange, max, boost, disabled, className }: VolumeControlProps): React.JSX.Element;
|
|
378
380
|
/** A choice of playback speed ("0.5×", "1×", "1.5×"), named "Playback speed": React Aria's Select. */
|
|
379
381
|
declare function RateChoice({ rate, onRateChange, rates, className }: {
|
|
380
382
|
rate: number;
|
|
@@ -543,9 +545,11 @@ type MediaElementState = {
|
|
|
543
545
|
duration: number | null;
|
|
544
546
|
/** Seconds buffered from the start of the range holding `time`. */
|
|
545
547
|
buffered: number;
|
|
546
|
-
/** 0 to 100; 0 while muted. */
|
|
548
|
+
/** 0 to 100 (to `maxVolume` with a boost); 0 while muted. */
|
|
547
549
|
volume: number;
|
|
548
550
|
muted: boolean;
|
|
551
|
+
/** The most `setVolume` takes: 100, or the `boost` option's level where the browser can play past the element's own (Web Audio). */
|
|
552
|
+
maxVolume: number;
|
|
549
553
|
rate: number;
|
|
550
554
|
ended: boolean;
|
|
551
555
|
/** Waiting for data (the first load, or a seek into what is not buffered yet). */
|
|
@@ -556,7 +560,7 @@ type MediaElementState = {
|
|
|
556
560
|
toggle: () => void;
|
|
557
561
|
/** Seeks; before the metadata has loaded, remembers the time and applies it when it has. */
|
|
558
562
|
seek: (time: number) => void;
|
|
559
|
-
/** 0 to
|
|
563
|
+
/** 0 to `maxVolume`. 0 mutes; more unmutes at that level; past 100 is the `boost`. */
|
|
560
564
|
setVolume: (volume: number) => void;
|
|
561
565
|
setRate: (rate: number) => void;
|
|
562
566
|
/** Loads again, and plays if it was playing. For the error state's "Try again". */
|
|
@@ -594,6 +598,10 @@ type MediaElementOptions = {
|
|
|
594
598
|
progressEvery?: number;
|
|
595
599
|
/** Names what is being played, so the count starts again when it changes. Default the element's `src` attribute; give it for a stream attached by an engine. */
|
|
596
600
|
progressKey?: string;
|
|
601
|
+
/** A factor on the sound, played through Web Audio: an app's loudness normalisation (2 is twice as loud, 0.5 half), so 100% on the volume is the level the app chose. A change glides there over a second or two. Peaks past full scale are held by a limiter. `null` or 1 leaves the sound alone. Only for a same-origin source (or one served with CORS): a browser gives Web Audio silence from another site's file. See `media-sound.ts`. */
|
|
602
|
+
gain?: number | null;
|
|
603
|
+
/** Let the volume go past 100%, to this many percent (200 is twice as loud), through Web Audio with the same limiter. Where the browser has no Web Audio the volume stops at 100. */
|
|
604
|
+
boost?: number;
|
|
597
605
|
};
|
|
598
606
|
/** Follows an `<audio>` or `<video>` and returns its state and the requests a player makes. Works with the browser's own controls too. */
|
|
599
607
|
declare function useMediaElement(ref: React.RefObject<HTMLMediaElement | null>, options?: MediaElementOptions): MediaElementState;
|
|
@@ -740,6 +748,12 @@ type MediaPlayerProps = {
|
|
|
740
748
|
status?: React.ReactNode;
|
|
741
749
|
/** A transient warning from `usePlayerWarnings`, shown independently of the controls. */
|
|
742
750
|
warning?: PlayerWarningEvent;
|
|
751
|
+
/** A factor on the sound, so 100% on the volume is the level the app chose: its loudness normalisation (a quiet file made as loud as the others, a loud one brought down). Played through Web Audio with a limiter that holds peaks under full scale; a change glides there. `null` or 1 leaves the sound alone. Same-origin sources only (or CORS): a browser gives Web Audio silence from another site's file. */
|
|
752
|
+
gain?: number | null;
|
|
753
|
+
/** How the element asks for its file (`crossOrigin`): set it for a file on another site served with CORS, so `gain` and `boost` can reach its sound. Without it such a file plays at its own level. */
|
|
754
|
+
crossOrigin?: "anonymous" | "use-credentials";
|
|
755
|
+
/** Let the volume go past 100%, to this many percent (200 is twice as loud), behind a Louder toggle beside the slider; the wheel goes on past 100 only once the volume is there. Through Web Audio with the same limiter; where the browser has none, no toggle. */
|
|
756
|
+
boost?: number;
|
|
743
757
|
/** The picture's shape before its metadata loads (and after, when given): a width over a height, or "16/9". Default "16/9" until the video says its own. */
|
|
744
758
|
aspect?: number | `${number}/${number}`;
|
|
745
759
|
/** A video has a Full screen button (and the `f` key) beside the speed and volume. Default true; `false` for a picture that must stay in its place. Only where the browser has the Fullscreen API (the window-filling fallback would mount the video again and lose its place). Not drawn with the browser's own controls (`controls="native"`, or `"auto"` on a touch device), which have their own. */
|
|
@@ -753,6 +767,6 @@ declare const SPEECH_RATES: readonly number[];
|
|
|
753
767
|
* a touch device), with the failure to load shown and retried. For an editor or a replay, use the
|
|
754
768
|
* parts and `useMediaElement` directly.
|
|
755
769
|
*/
|
|
756
|
-
declare function MediaPlayer({ label, kind, src, sources, index: controlledIndex, onIndexChange, autoAdvance, controls, autoPlay, poster, session, rates, shortcuts, attach, growing, window: bound, loop, showFull, group, onTimeUpdate, onWindowEnd, onEnded, onTimeChange, spans, spanKinds, marks, onSpan, spanWords, start, resumeWords, onProgress, progressEvery, mediaRef, heading, overlay, status, warning, aspect, fullscreen, skip, fps, float, className }: MediaPlayerProps): React.JSX.Element;
|
|
770
|
+
declare function MediaPlayer({ label, kind, src, sources, index: controlledIndex, onIndexChange, autoAdvance, controls, autoPlay, poster, session, rates, shortcuts, attach, growing, window: bound, loop, showFull, group, onTimeUpdate, onWindowEnd, onEnded, onTimeChange, spans, spanKinds, marks, onSpan, spanWords, start, resumeWords, onProgress, progressEvery, mediaRef, heading, overlay, status, warning, gain, boost, crossOrigin, aspect, fullscreen, skip, fps, float, className }: MediaPlayerProps): React.JSX.Element;
|
|
757
771
|
export { LineChartGroupProps as $, RateChoice as A, VolumeControlProps as B, SpanBehaviour as C, useMediaSpans as D, SpanWords as E, StageGuides as F, isTypingTarget as G, HotkeysOptions as H, TimeReadout as I, ChartMark as J, keyName as K, Transport as L, SeekBarProps as M, SeekBarSpan as N, MediaStage as O, SpanStrip as P, LineChartGroup as Q, TransportProps as R, SpanActionsNotice as S, SpanOutcome as T, KeysLegend as U, transportShortcuts as V, Shortcut as W, GroupedChart as X, ChartSpan as Y, LineChart as Z, MediaProgress as _, skipAction as _t, MediaPlayerProps as a, valueAt as at, PlayerNotice as b, usePlayerWarnings as bt, MediaSource as c, CursorScope as ct, SPEECH_RATES as d, useSharedCursor as dt, LineChartProps as et, SourceAttacher as f, MediaMark as ft, useMediaElement as g, marksFor as gt, useAttachedSource as h, SkipSteps as ht, MediaPlayer as i, logScale as it, SeekBar as j, Precision as k, MediaWindow as l, CursorScopeProps as lt, StreamContext as m, SkipLevel as mt, MediaElementState as n, SpanTone as nt, MediaProblem as o, CursorMapping as ot, StreamAttachment as p, SkipAction as pt, useHotkeys as q, MediaHeading as r, YScale as rt, MediaSession as s, CursorOwner as st, MediaElementOptions as t, Point as tt, ResumeWords as u, SharedCursor as ut, MediaSpanData as v, PlayerWarning as vt, SpanKind as w, SpanActions as x, MediaSpansState as y, PlayerWarningEvent as yt, VolumeControl as z };
|
|
758
|
-
//# sourceMappingURL=media-player-
|
|
772
|
+
//# sourceMappingURL=media-player-Buvu2l7R.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strata-react",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "React + Tailwind v4 components that ship structure, behaviour, states and a token contract, and no look: each product brings a theme generated from its own subject.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|