var video           = document.getElementById("video-stream");
var decisionTime    = 15;
var decicsionActive = false;

ws.onmessage = function(message) {
  var data = JSON.parse(message.data);
  // console.log(data)
  if (data.video) {
    var source = document.querySelectorAll("#video-player video source");
    source[0].src = data.video;
    video.load();
    video.play();
    $("#decision-logo ").hide();
    if (data.question != null) { decicsionActive = false; }
  } else if (data.the_end) {
    $("#decision-logo").html('The End');
    $("#decision-logo").fadeIn( 3000 );
  }
};

$("#video-stream").on("timeupdate", function() {
    // TODO: Just calculate that once
    var decicsionTime = this.duration - decisionTime;

    if (this.currentTime > decicsionTime && decicsionActive == false) {
      $("#decision-logo").fadeIn( 3000 );
      ws.send(JSON.stringify({ decision_active: true }));
      decicsionActive = true;
    }
});

$("#video-stream").on("ended", function() {
  ws.send(JSON.stringify({ video: 'ended' }));
});

$(document).ready(function() {
  $("#decision-logo").hide();
});

var video           = document.getElementById("video-stream");
var decisionTime    = 15;
var decicsionActive = false;

ws.onmessage = function(message) {
  var data = JSON.parse(message.data);
  // console.log(data)
  if (data.video) {
    var source = document.querySelectorAll("#video-player video source");
    source[0].src = data.video;
    video.load();
    video.play();
    $("#decision-logo ").hide();
    if (data.question != null) { decicsionActive = false; }
  } else if (data.the_end) {
    $("#decision-logo").html('<div><p>Ende</p></br> <h1> Bitte nimm dir kurz Zeit uns Feedback zu geben. </h1><h1> Mit deiner Hilfe können wir den Film weiter verbessern. </h1></br><h1> Danke! </h1></br><a href="https://indivsurvey.de/umfrage/26279/F66fMP"> Klicke hier um zur Onlineumfrage zu gelangen! </a></div>');
    $("#decision-logo").fadeIn( 3000 );
  }
};

$("#video-stream").on("timeupdate", function() {
    // TODO: Just calculate that once
    var decicsionTime = this.duration - decisionTime;

    if (this.currentTime > decicsionTime && decicsionActive == false) {
      $("#decision-logo").fadeIn( 3000 );
      ws.send(JSON.stringify({ decision_active: true }));
      decicsionActive = true;
    }
});

$("#video-stream").on("ended", function() {
  ws.send(JSON.stringify({ video: 'ended' }));
});

$(document).ready(function() {
  $("#decision-logo").hide();
});

Add online survey link add the end for usability test
Add online survey link add the end for usability test
