animot-presenter 0.5.16 → 0.5.17

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.
@@ -155,7 +155,7 @@
155
155
  let {
156
156
  src, data, autoplay = false, loop = false, controls = true, arrows = false,
157
157
  progress: showProgress = true, keyboard = true, duration: durationOverride,
158
- startSlide = 0, class: className = '', onslidechange, oncomplete
158
+ startSlide = 0, muteNarration = false, class: className = '', onslidechange, oncomplete
159
159
  }: AnimotPresenterProps = $props();
160
160
 
161
161
  // State
@@ -199,6 +199,7 @@
199
199
  // the user's click on the play control is itself the unlocking gesture.
200
200
  let narrationAudio: HTMLAudioElement | null = null;
201
201
  function playNarrationForSlide(index: number) {
202
+ if (muteNarration) return;
202
203
  if (!project?.settings?.narrationEnabled) return;
203
204
  const slide = project?.slides?.[index];
204
205
  if (narrationAudio) {
@@ -558,6 +559,12 @@
558
559
  currentSlideIndex = 0;
559
560
  isTransitioning = false;
560
561
 
562
+ // Restart narration on loop. Setting `currentSlideIndex = 0` above
563
+ // is a no-op for single-slide decks (was already 0) so the play-state
564
+ // effect doesn't re-fire on its own. Calling explicitly here covers
565
+ // both single- and multi-slide loops uniformly.
566
+ if (isAutoplay) playNarrationForSlide(0);
567
+
561
568
  for (const element of firstSlide.canvas.elements) {
562
569
  if (element.type === 'text') {
563
570
  const textEl = element as TextElement;