SOURCE

console 命令行工具 X clear

                    
>
console
    var canvas = document.getElementById('canvas');
    var editor = new Editor(canvas);
  
    let videoNode = editor.image("https://sf6-ttcdn-tos.pstatp.com/obj/web.business.image/202106035d0d91c31c8a1fef4a9aabb8", {
      top: 80,
      width: 200,
      height: 200,
    });
    let videoNode1 = editor.image("https://sf6-ttcdn-tos.pstatp.com/obj/web.business.image/202106035d0d91c31c8a1fef4a9aabb8", {
      top: 0,
      width: 840,
      height: 600,
    });

    videoNode.timelineStart(0);
    videoNode.timelineStop(4.4);

    videoNode1.timelineStart(0);
    videoNode1.timelineStop(4.4);

    // videoNode1.connect(editor.output);
    var effectNode = editor.transition(Editor.DEFINITIONS.GAUSSIANBLUR());
    effectNode.transition(0, 4.4);
    videoNode1.connect(effectNode);
    var effectNode2 = editor.transition(Editor.DEFINITIONS.GAUSSIANBLUR());
    effectNode2.transition(0, 4.4);
    effectNode.connect(effectNode2);
    effectNode2.connect(editor.output);
    videoNode.connect(editor.output);


    let wrapper = document.getElementById('wrapper');

    initButton();
    InitVisualisations(editor, 'timeline-canvas', 'currentTime');

    let graphCanvas = document.getElementById('graph');
    Editor.utils.visualiseVideoContextGraph(editor, graphCanvas);
    editor.on('timeupdate', () => {
      Editor.utils.visualiseVideoContextGraph(editor, graphCanvas);
    })

    function initButton() {
      var playButton = document.getElementById('play-button');
      var pauseButton = document.getElementById('pause-button');
      playButton.onclick = editor.play.bind(editor);
      pauseButton.onclick = editor.pause.bind(editor);

    }

  <head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
  <canvas width="640" height="360" id="canvas"></canvas>
  <p id="currentTime"></p>
  <p>
    <canvas id="timeline-canvas" width="640", height="20"></canvas>
</p>
  <p>
    <button id="play-button">play</button>
    <button id="pause-button">pause</button>
  </p>
  <canvas width="640" height="360" id="graph"></canvas>
html {
    font-family: monospace;
    color: #333;
    /* background-color: black; */
  }
  #current {
    font-size: 12px;
  }
  #canvas {
    width: 640px;
    height: 360px;
  }
  #canvas2 {
    width: 640px;
    height: 360px;
    position: absolute;
    left: 0px;
    top: 0px;
    z-index: 10;
  }
  #container {
    position: relative;
  }

  button {
    line-height: 1.499;
      position: relative;
      display: inline-block;
      font-weight: 400;
      white-space: nowrap;
      text-align: center;
      background-image: none;
      border: 1px solid transparent;
      cursor: pointer;
      user-select: none;
      height: 32px;
      padding: 0 15px;
      font-size: 14px;
      border-radius: 4px;
      color: rgba(0,0,0,0.65);
      background-color: #fff;
      border-color: #d9d9d9;
      outline: 0;
      transition: all .3s cubic-bezier(.645, .045, .355, 1);
  }

  button:hover {
    color: #40a9ff;
    background-color: #fff;
    border-color: #40a9ff;
  }

  button:active {
    color: #096dd9;
    background-color: #fff;
    border-color: #096dd9;
  }

  input[type="text"] {
    -webkit-appearance: none;
    background-color: #fff;
    background-image: none;
    border-radius: 4px;
    border: 1px solid #dcdfe6;
    box-sizing: border-box;
    color: #606266;
    display: inline-block;
    font-size: inherit;
    height: 32px;
    line-height: 32px;
    outline: none;
    padding: 0 8px;
    transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    width: 50px;
  }

  .wrapper {
    width: 640px;
    height: 360px;
    position: relative;
  }

@font-face {
  font-family: "hardFont";
  src: url('./assets/hardFont.ttf');
}

本项目引用的自定义外部资源