UNPKG

@nethesis/phone-island

Version:
3 lines (2 loc) 1.59 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),i=require("../utils/customHooks/useEventListener.js"),r=require("../utils/genericFunctions/eventDispatch.js");require("../node_modules/tslib/tslib.es6.js");var t=require("../store/index.js");require("../node_modules/react-redux/es/index.js");var n=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=n.useDispatch();return i.useEventListener("phone-island-recording-open",(function(i){e.island.setIslandView("recorder"),r.eventDispatch("phone-island-recording-opened",{})})),i.useEventListener("phone-island-physical-recording-view",(function(i){e.island.setIslandView("physicalPhoneRecorder"),r.eventDispatch("phone-island-physical-recording-opened",{}),setTimeout((function(){r.eventDispatch("phone-island-physical-recording-open",{})}),500)})),o.default.createElement(o.default.Fragment,null)},exports.dispatchPhysicalRecordingSave=function(){var e=t.store.getState().physicalRecorder.tempFileName;console.log("dispatchPhysicalRecordingSave",e),r.eventDispatch("phone-island-physical-recording-saved",{tempFileName:e})},exports.dispatchRecordingSave=function(){var e,i,n=t.store.getState().recorder.tempFileName,s=(null===(i=null===(e=t.store.getState().player.audioPlayer)||void 0===e?void 0:e.current)||void 0===i?void 0:i.src)||"";r.eventDispatch("phone-island-recording-saved",{tempFileName:n,audioFileURL:s})}; //# sourceMappingURL=RecorderEvents.js.map