@superinterface/react 2.4.3 → 2.4.4

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/dist/index.cjs CHANGED
@@ -3080,13 +3080,22 @@ var useMessageAudio = function(param) {
3080
3080
  ]);
3081
3081
  var isInited = (0, import_react40.useRef)(false);
3082
3082
  var _ref2 = _sliced_to_array((0, import_react40.useState)(null), 2), audioEngine = _ref2[0], setAudioEngine = _ref2[1];
3083
+ (0, import_react40.useEffect)(function() {
3084
+ if (isHtmlAudioSupported) {
3085
+ var _import_howler_Howler__howls___sounds_, _import_howler_Howler__howls_, _import_howler_Howler;
3086
+ if (!((_import_howler_Howler = import_howler.Howler) === null || _import_howler_Howler === void 0 ? void 0 : (_import_howler_Howler__howls_ = _import_howler_Howler._howls[0]) === null || _import_howler_Howler__howls_ === void 0 ? void 0 : (_import_howler_Howler__howls___sounds_ = _import_howler_Howler__howls_._sounds[0]) === null || _import_howler_Howler__howls___sounds_ === void 0 ? void 0 : _import_howler_Howler__howls___sounds_._node)) return;
3087
+ if (!import_howler.Howler._howls[0]._sounds[0]._node.crossOrigin) return;
3088
+ import_howler.Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
3089
+ }
3090
+ }, [
3091
+ audioPlayer
3092
+ ]);
3083
3093
  (0, import_react40.useEffect)(function() {
3084
3094
  if (!audioPlayer.playing) return;
3085
3095
  if (isInited.current) return;
3086
3096
  isInited.current = true;
3087
3097
  if (isHtmlAudioSupported) {
3088
3098
  var audioContext = new AudioContext();
3089
- import_howler.Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
3090
3099
  setAudioEngine({
3091
3100
  // @ts-ignore-next-line
3092
3101
  source: audioContext.createMediaElementSource(import_howler.Howler._howls[0]._sounds[0]._node),