Sunday, March 1, 2020

Play Sound file in IBM Sterling WMS/OMS

/* Set Sound File Path during Page load - JSP code */
var soundFile="<%=request.getContextPath()%>/extn/sound/ErrorSound.mp3";

/* Set Dummy id during Page load - JSP code */
<span id="dummySoundFrame"></span>

/* Call Sound When there is Error Scenario occured - Javascript code */
PlaySoundForError(soundFile);

/* Function Definition for Sound - Javascript code */
function PlaySoundForError(soundfile) {
   document.getElementById("dummySoundFrame").innerHTML= "<embed src='"+soundfile+"' hidden='true' autostart='true' loop='false' />";
}

No comments:

Post a Comment

Popular Posts