export default e=>{window?.wp?.hooks&&(e.on("ready",(()=>{doAction("Ready",e)})),e.on("play",(()=>{doAction("Play",e)})),e.on("playing",(()=>{doAction("Playing",e)})),e.on("pause",(()=>{doAction("Pause",e)})),e.on("ended",(()=>{doAction("Ended",e)})),e.on("seeked",(()=>{doAction("Seeked",e)})),e.on("timeupdate",(()=>{doAction("TimeUpdate",e)})),e.on("enterfullscreen",(()=>{doAction("EnterFullScreen",e)})),e.on("exitfullscreen",(()=>{doAction("ExitFullScreen",e)})),document.addEventListener("visibilitychange",(()=>{doAction("hidden"===document.visibilityState?"Hidden":"Visible",e)})),e.on("statechange",(o=>{switch(o?.detail?.code){case 0:doAction("Ended",e);break;case 1:doAction("Play",e);break;case 2:doAction("Pause",e)}})))};export function doAction(e,o){window.wp.hooks.doAction(`presto.player${e}`,o)}