]> git.parisson.com Git - mezzo.git/commitdiff
[Vertigo M&C] : streaming begin + end for one event
authorEmilie <zawadzki@ircam.fr>
Wed, 15 Mar 2017 11:32:47 +0000 (12:32 +0100)
committerEmilie <zawadzki@ircam.fr>
Wed, 15 Mar 2017 11:32:47 +0000 (12:32 +0100)
app/themes/base/static/src/js/modules/live-streaming-counter.js

index c1bcfaf944e9d436069f928000f0f43db77b958a..ff84cd36b6424404e202f4e1b913b013def97675 100644 (file)
@@ -48,14 +48,16 @@ function CountDownTimer(dt_begin, dt_end, id, video_id/*, video_url*/)
         function showRemaining() {
             var now = new Date();
             var distance_out = begin - now;
+            console.log("distance_out", distance_out)
 
             if (distance_out < 0) {
-                clearInterval(timer);
+                //clearInterval(timer);
                 // $('#countdown-title').html('<br /><br />');
                 // $('#'+id).html('<br />');
                 // $('#live').html('- Live !');
                 //switchVideo(video_id, video_url);
                 $('.countdown-overlay').hide()
+                distance_in = 1;
                 nextEvent()
                 return;
             }
@@ -77,6 +79,7 @@ function CountDownTimer(dt_begin, dt_end, id, video_id/*, video_url*/)
         function nextEvent() {
             var now = new Date();
             var distance_in = end - now;
+            console.log("distance_in", distance_in)
 
             if (distance_in < 0) {
                 $('.countdown-overlay').show()
@@ -90,6 +93,8 @@ function CountDownTimer(dt_begin, dt_end, id, video_id/*, video_url*/)
         if (distance_out > 0) {
             timer = setInterval(showRemaining, 1000);
         }
+
+        console.log("distance_in", distance_in)
         if (distance_in > 0) {
             timer = setInterval(nextEvent, 1000);
         }