@waveform-playlist/browser 10.0.0 → 10.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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Naomi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ import { DragMoveEvent } from '@dnd-kit/abstract';
7
7
  import { DragOperation } from '@dnd-kit/abstract';
8
8
  import { DragStartEvent } from '@dnd-kit/abstract';
9
9
  import { EngineState } from '@waveform-playlist/engine';
10
+ import { FadeConfig } from '@waveform-playlist/media-element-playout';
10
11
  import { Gain } from 'tone';
11
12
  import { InputNode } from 'tone';
12
13
  import { MediaElementPlayout } from '@waveform-playlist/media-element-playout';
@@ -774,6 +775,8 @@ export declare interface MediaElementDataContextValue {
774
775
  barWidth: number;
775
776
  barGap: number;
776
777
  progressBarWidth: number;
778
+ fadeIn?: FadeConfig;
779
+ fadeOut?: FadeConfig;
777
780
  }
778
781
 
779
782
  /**
@@ -804,6 +807,8 @@ export declare interface MediaElementPlaylistProps {
804
807
  onAnnotationUpdate?: OnAnnotationUpdateFn;
805
808
  /** Custom playhead render function. Receives position, color, and animation refs for smooth 60fps animation. */
806
809
  renderPlayhead?: RenderPlayheadFunction;
810
+ /** Show fade in/out overlays on the waveform. Defaults to false. */
811
+ showFades?: boolean;
807
812
  className?: string;
808
813
  }
809
814
 
@@ -858,6 +863,16 @@ declare interface MediaElementPlaylistProviderProps {
858
863
  progressBarWidth?: number;
859
864
  /** Callback when annotations are changed (drag, edit, etc.) */
860
865
  onAnnotationsChange?: (annotations: AnnotationData[]) => void;
866
+ /**
867
+ * AudioContext for Web Audio routing (fades, effects).
868
+ * When provided, audio routes through Web Audio nodes:
869
+ * HTMLAudioElement → MediaElementSourceNode → fadeGain → volumeGain → destination
870
+ *
871
+ * Without this, playback uses HTMLAudioElement directly (no fades or effects).
872
+ * Each provider instance should use its own AudioContext or share one —
873
+ * createMediaElementSource() is called once per audio element.
874
+ */
875
+ audioContext?: AudioContext;
861
876
  /** Callback when audio is ready */
862
877
  onReady?: () => void;
863
878
  children: ReactNode;
@@ -878,6 +893,10 @@ export declare interface MediaElementTrackConfig {
878
893
  waveformData: WaveformDataObject;
879
894
  /** Track name for display */
880
895
  name?: string;
896
+ /** Fade in configuration (requires audioContext on provider) */
897
+ fadeIn?: FadeConfig;
898
+ /** Fade out configuration (requires audioContext on provider) */
899
+ fadeOut?: FadeConfig;
881
900
  }
882
901
 
883
902
  /**
@@ -920,6 +939,8 @@ export declare interface MediaElementWaveformProps {
920
939
  scrollActiveContainer?: 'nearest' | 'all';
921
940
  /** Custom playhead render function. Receives position, color, and animation refs for smooth 60fps animation. */
922
941
  renderPlayhead?: RenderPlayheadFunction;
942
+ /** Show fade in/out overlays on the waveform. Defaults to false. */
943
+ showFades?: boolean;
923
944
  className?: string;
924
945
  }
925
946