Title: Webcam countdown time
Last modified: September 3, 2020

---

# Webcam countdown time

 *  [marcolinux](https://wordpress.org/support/users/marcolinux/)
 * (@marcolinux)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/webcam-countdown-time/)
 * 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](https://wordpress.org/support/users/nickboss/)
 * (@nickboss)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/webcam-countdown-time/#post-13366014)
 * 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.

 * ![](https://ps.w.org/wp-file-upload/assets/icon-256x256.png?rev=3252590)
 * [Iptanus File Upload](https://wordpress.org/plugins/wp-file-upload/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-file-upload/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-file-upload/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-file-upload/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-file-upload/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-file-upload/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [nickboss](https://wordpress.org/support/users/nickboss/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/webcam-countdown-time/#post-13366014)
 * Status: not resolved