@superinterface/react 2.4.3 → 2.4.5
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 +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3080,13 +3080,21 @@ 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
|
+
import_howler.Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
|
|
3088
|
+
}
|
|
3089
|
+
}, [
|
|
3090
|
+
audioPlayer
|
|
3091
|
+
]);
|
|
3083
3092
|
(0, import_react40.useEffect)(function() {
|
|
3084
3093
|
if (!audioPlayer.playing) return;
|
|
3085
3094
|
if (isInited.current) return;
|
|
3086
3095
|
isInited.current = true;
|
|
3087
3096
|
if (isHtmlAudioSupported) {
|
|
3088
3097
|
var audioContext = new AudioContext();
|
|
3089
|
-
import_howler.Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
|
|
3090
3098
|
setAudioEngine({
|
|
3091
3099
|
// @ts-ignore-next-line
|
|
3092
3100
|
source: audioContext.createMediaElementSource(import_howler.Howler._howls[0]._sounds[0]._node),
|