在另一个窗口上绘制画布中的视频

时间:2016-11-07 17:50:48

标签: javascript video canvas

我有一个问题是在IE浏览器的另一个画布上绘制视频,它在另一个webbrowser上工作正常,但是IE出错了

  <body>
<video id='video' src='http://clips.vorwaerts-gmbh.de/VfE_html5.mp4' controls></video>
<button id='button'>Open Window</button>
<script>
  var video = document.getElementById("video");
  var button = document.getElementById('button');
  var popup = null;
  button.onclick = function() {
    if(popup == null){
      popup = window.open("", "", "width=640,height=360");
      var canvas = popup.document.createElement('canvas');
      canvas.id = 'Canvas';
      popup.document.body.appendChild(canvas);
      popup.onbeforeunload = function(){
        popup = null;
      }
      setInterval(function() {
        var temp = popup.document.getElementById('Canvas');
        if (temp != null) {
          temp.width = popup.innerWidth;
          temp.height = popup.innerHeight;
          try {
            temp.getContext("2d").drawImage(video, 0, 0, temp.width, temp.height);
          } catch (e) {
            console.log(e)
          }
        }
      }, 1000/30)
    }
  }
</script>

当我想在这个画布中绘制视频时,不要在Internet Explorer中工作 当我抓住它时,IE给出了这个错误:

TypeMismatchError
  [functions]: ,
  ABORT_ERR: 20,
  code: 17,
  DATA_CLONE_ERR: 25,
  DOMSTRING_SIZE_ERR: 2,
  HIERARCHY_REQUEST_ERR: 3,
  INDEX_SIZE_ERR: 1,
  INUSE_ATTRIBUTE_ERR: 10,
  INVALID_ACCESS_ERR: 15,
  INVALID_CHARACTER_ERR: 5,
  INVALID_MODIFICATION_ERR: 13,
  INVALID_NODE_TYPE_ERR: 24,
  INVALID_STATE_ERR: 11,
  message: "TypeMismatchError",
  name: "TypeMismatchError",
  NAMESPACE_ERR: 14,
  NETWORK_ERR: 19,
  NO_DATA_ALLOWED_ERR: 6,
  NO_MODIFICATION_ALLOWED_ERR: 7,
  NOT_FOUND_ERR: 8,
  NOT_SUPPORTED_ERR: 9,
  PARSE_ERR: 81,
  QUOTA_EXCEEDED_ERR: 22,
  SECURITY_ERR: 18,
  SERIALIZE_ERR: 82,
  SYNTAX_ERR: 12,
  TIMEOUT_ERR: 23,
  TYPE_MISMATCH_ERR: <Permission refusée>,
  URL_MISMATCH_ERR: <Permission refusée>,
  VALIDATION_ERR: <Permission refusée>,
  WRONG_DOCUMENT_ERR: <Permission refusée>

你有想法解决这个问题吗?

0 个答案:

没有答案