@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 +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2953,13 +2953,22 @@ var useMessageAudio = function(param) {
|
|
|
2953
2953
|
]);
|
|
2954
2954
|
var isInited = useRef5(false);
|
|
2955
2955
|
var _useState42 = _sliced_to_array(useState4(null), 2), audioEngine = _useState42[0], setAudioEngine = _useState42[1];
|
|
2956
|
+
useEffect5(function() {
|
|
2957
|
+
if (isHtmlAudioSupported) {
|
|
2958
|
+
var _Howler__howls___sounds_, _Howler__howls_;
|
|
2959
|
+
if (!(Howler === null || Howler === void 0 ? void 0 : (_Howler__howls_ = Howler._howls[0]) === null || _Howler__howls_ === void 0 ? void 0 : (_Howler__howls___sounds_ = _Howler__howls_._sounds[0]) === null || _Howler__howls___sounds_ === void 0 ? void 0 : _Howler__howls___sounds_._node)) return;
|
|
2960
|
+
if (!Howler._howls[0]._sounds[0]._node.crossOrigin) return;
|
|
2961
|
+
Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
|
|
2962
|
+
}
|
|
2963
|
+
}, [
|
|
2964
|
+
audioPlayer
|
|
2965
|
+
]);
|
|
2956
2966
|
useEffect5(function() {
|
|
2957
2967
|
if (!audioPlayer.playing) return;
|
|
2958
2968
|
if (isInited.current) return;
|
|
2959
2969
|
isInited.current = true;
|
|
2960
2970
|
if (isHtmlAudioSupported) {
|
|
2961
2971
|
var audioContext = new AudioContext();
|
|
2962
|
-
Howler._howls[0]._sounds[0]._node.crossOrigin = "anonymous";
|
|
2963
2972
|
setAudioEngine({
|
|
2964
2973
|
// @ts-ignore-next-line
|
|
2965
2974
|
source: audioContext.createMediaElementSource(Howler._howls[0]._sounds[0]._node),
|