var soundBtn=document.getElementById("soundBtn"); var ccBtn= document.getElementById("ccBtn"); var soundState=true,ccState=false; var soundLottie = document.getElementById("soundLottie"); var userID = "djisd"; if (typeof(Storage) !== "undefined") { soundState= window.localStorage.getItem("sound"+userID)=="false"?false:true; // soundBtn.src=soundState?"/textures/icons/soundStateOn.png":"/textures/icons/soundStateOff.png"; if(!soundState){ mutePage(); soundLottie.getLottie().playSegments([0,31],true); window.localStorage.setItem("sound"+userID, "false"); } else{ unmutePage(); soundLottie.getLottie().playSegments([31,60],true); window.localStorage.setItem("sound"+userID, "true"); } } $(document).ready(function () { soundLottie = document.getElementById("soundLottie"); ccBtn= document.getElementById("ccBtn"); soundBtn= document.getElementById("soundBtn"); $(soundBtn).click(function () { soundToggle(); }); $(ccBtn).click(function () { ccToggle(); }); // $(soundBtn).mouseover(function () { activateLowerThird("Toggle Audio"); }); // $(soundBtn).mouseout(function () { disableLowerThird(); }); }); function ccToggle(){ ccState=!ccState; ccBtn.src=ccState?"/textures/icons/cc_on.png":"/textures/icons/cc_off.png"; playSoundOneShot("secondaryBtn.wav"); } function soundToggle(){ soundState=!soundState; // soundBtn.src=soundState?"/textures/icons/soundStateOn.png":"/textures/icons/soundStateOff.png"; if (activeFrame.style.display == "block") { if (typeof activeFrame.contentWindow.volumeSetKrdo !== "undefined") activeFrame.contentWindow.volumeSetKrdo(soundState ? 1 : 0); } else { if (typeof inactiveFrame.contentWindow.volumeSetKrdo !== "undefined") inactiveFrame.contentWindow.volumeSetKrdo(soundState ? 1 : 0); } if(!soundState){ mutePage(); soundLottie.getLottie().playSegments([0,31],true); window.localStorage.setItem("sound"+userID, "false"); } else{ unmutePage(); soundLottie.getLottie().playSegments([31,60],true); window.localStorage.setItem("sound"+userID, "true"); } playSoundOneShot("secondaryBtn.wav"); } function mutePage() { audioPlayerOneShot.volume =0; audioVoiceover.volume=0; audioPlayerOneShotOverlap.volume=0; } function unmutePage() { audioPlayerOneShot.volume =1; audioVoiceover.volume=1; audioPlayerOneShotOverlap.volume=1; }