@nethesis/phone-island
Version:
NethVoice CTI Phone Island
3 lines (2 loc) • 1.54 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../utils/customHooks/useEventListener.js"),i=require("../utils/genericFunctions/eventDispatch.js"),n=require("../store/index.js");require("../node_modules/react-redux/es/index.js");var r=require("../node_modules/react-redux/es/hooks/useDispatch.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=s(e);exports.RecorderEvents=function(){var e=r.useDispatch();return t.useEventListener("phone-island-recording-open",(function(t){e.island.setIslandView("recorder"),i.eventDispatch("phone-island-recording-opened",{})})),t.useEventListener("phone-island-physical-recording-view",(function(t){e.island.setIslandView("physicalPhoneRecorder"),i.eventDispatch("phone-island-physical-recording-opened",{}),setTimeout((function(){i.eventDispatch("phone-island-physical-recording-open",{})}),500)})),o.default.createElement(o.default.Fragment,null)},exports.dispatchPhysicalRecordingSave=function(){var e=n.store.getState().physicalRecorder.tempFileName;console.log("dispatchPhysicalRecordingSave",e),i.eventDispatch("phone-island-physical-recording-saved",{tempFileName:e})},exports.dispatchRecordingSave=function(){var e,t,r=n.store.getState().recorder.tempFileName,s=(null===(t=null===(e=n.store.getState().player.audioPlayer)||void 0===e?void 0:e.current)||void 0===t?void 0:t.src)||"";i.eventDispatch("phone-island-recording-saved",{tempFileName:r,audioFileURL:s})};
//# sourceMappingURL=RecorderEvents.js.map