//videoLoad
function story_component_video_load() {
  for (key in dataStory) {
    var dataObject = dataStory[key];

    if (dataObject["objectType"] == "video") {
      //grp
      var object = new Konva.Group({
        id: key,
        x: dataObject["x"],
        y: dataObject["y"],
      });
      grpStory.add(object);
      object.setAttr("data", dataObject);

      //rect
      var rect = new Konva.Rect({
        x: 0,
        y: 0,
        width: dataObject["width"],
        height: dataObject["height"],
      });
      object.add(rect);

      object.on("pointerdown ", function () {
        story_component_video_click(this);
      });

      initButton(object, 0);
    }
  }
}

function story_component_video_click(e) {
  var video = document.getElementById("video");
  video.src = stagePath + e.getAttr("data")["image"];
  video.play();
  document.getElementById("qcVideoBox").style.display = "block";
}

document.getElementById("qcVideoBox").style.display = "none";

document.getElementById("qcVideoBoxClose").onclick = function () {
  document.getElementById("video").pause();
  document.getElementById("qcVideoBox").style.display = "none";
};
