• Is it possible, once the max record time is set, to have a sort of countdown displayed so that the user who records can realize the time limit?

Viewing 1 replies (of 1 total)
  • Plugin Author nickboss

    (@nickboss)

    Hi, actually there is a counter but seems that it does not work as intended.

    Here is a script that shows a reverse counter during recording:

    <script type="text/javascript">
    if(window.addEventListener) { window.addEventListener("load", wfu_webcam_revcounter, false); } else if(window.attachEvent) { window.attachEvent("onload", wfu_webcam_revcounter); } else { window["onload"] = wfu_webcam_revcounter; }
    function wfu_webcam_revcounter() {
        document.querySelector(".wfu_file_webcam_btn_time_tb").style.width = "auto";
        wfu_webcam_update_counter = function(sid) {
            var webcam_obj = GlobalData.WFU[sid].webcam;
            var webcam_props = GlobalData.WFU[sid].webcamProps;
            if (webcam_props.counting) {
                var d = new Date();
                var dif = webcam_props.maxrecordtime - d.getTime() / 1000 + webcam_props.timeStart;
                if (dif < 0) dif = 0;
                webcam_obj.updateTimer(dif);
                setTimeout(function() { wfu_webcam_update_counter(sid); }, 100);
            }
        }
        if (typeof GlobalData.WFU[1].webcam._updateButtonStatus == "undefined") {
            GlobalData.WFU[1].webcam._updateButtonStatus = GlobalData.WFU[1].webcam.updateButtonStatus;
            GlobalData.WFU[1].webcam.updateButtonStatus = function(status) {
                GlobalData.WFU[1].webcam._updateButtonStatus(status);
                if (status == "ready_playback" || status == "playing") {
                    var tim = document.getElementById("webcam_1_btn_time");
                    tim.style.display = "block";
                    tim.style.visibility = "hidden";
                }
            }
        }
    }
    </script>

    You need to put it inside the page right below the shortcode.

    Try it and let me know.

    Regards

    Nickoals

Viewing 1 replies (of 1 total)
  • The topic ‘Webcam countdown time’ is closed to new replies.