@geekapps/silo-elements-nextjs 0.3.7 → 0.3.8

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.
@@ -821,15 +821,23 @@ function Video({
821
821
  });
822
822
  let mediaErrorAttempts = 0;
823
823
  hls.on(Hls.Events.ERROR, (_, data) => {
824
- console.debug("[Silo/hls] ERROR fatal=", data.fatal, "type=", data.type, "details=", data.details, "url=", (data.frag?.url ?? data.url ?? "").slice(-80));
824
+ const fragUrl = (data.frag?.url ?? data.url ?? "").slice(-80);
825
+ const fragType = data.frag?.type ?? "?";
826
+ console.debug("[Silo/hls] ERROR fatal=", data.fatal, "type=", data.type, "details=", data.details, "fragType=", fragType, "url=", fragUrl);
825
827
  if (!data.fatal) return;
828
+ if (data.details === Hls.ErrorDetails.FRAG_PARSING_ERROR && fragType === "audio") {
829
+ console.warn("[Silo/hls] audio frag parse failed \u2014 disabling separate audio tracks and retrying");
830
+ setAudioTracks([]);
831
+ hls.recoverMediaError();
832
+ return;
833
+ }
826
834
  if (data.type === Hls.ErrorTypes.MEDIA_ERROR && mediaErrorAttempts < 2) {
827
835
  mediaErrorAttempts += 1;
828
836
  console.debug("[Silo/hls] recoverMediaError attempt", mediaErrorAttempts);
829
837
  hls.recoverMediaError();
830
838
  return;
831
839
  }
832
- console.error("[Silo] HLS playback failed", data.details);
840
+ console.error("[Silo] HLS playback failed", data.details, "fragType=", fragType, "url=", fragUrl);
833
841
  hls.destroy();
834
842
  hlsRef.current = null;
835
843
  setIsLoading(false);