简体   繁体   English

我的JavaScript有什么问题? 在Dreamweaver中一直给我一个错误

[英]What's wrong with my javascript? it keeps giving me an error in dreamweaver

At line 29(pixelScan) it shows me an error in dreamweaver i want to know what's wrong please help, i do not know what the error is, i am a noob at javascript so please help me: 在第29行(pixelScan),它向我显示了Dreamweaver中的一个错误,我想知道这是什么错误,请帮助,我不知道错误是什么,我是javascript的菜鸟,所以请帮助我:

<script type="text/javascript">
var processes = {

  timerCallback: function() {
    if (this.myVideo.paused || this.myVideo.ended) {
      return;
    }
    this.videocontentPlayer.drawImage(this.myVideo, 0, 0, this.width, this.height);
    this.pixelScan();
    var self = this;
    setTimeout(function () {
      self.timerCallback();
      }, 0);
  },

  doLoad: function() {
    this.myVideo = document.getElementById("myVideo");
    this.videoPlayer = document.getElementById("videoPlayer");
    this.videocontentPlayer = this.videoPlayer.getContext("2d");
    this.videoPlayer2 = document.getElementById("videoPlayer2");
    this.videocontentPlayer2 = this.videoPlayer.getContext("2d");
    var self = this;
    this.myVideo.addEventListener("playing", function() {
      self.width = self.myVideo.videoWidth;
      self.height = self.myVideo.videoHeight;
      self.timerCallback();
    }, false);
  }

  pixelScan: function() {
    var frame = this.videocontentPlayer.getImageData(0, 0, this.width, this.height);
    for (var i = 0; i < frame.data.length; i++) {
      var r = frame.data[i];
      var g = frame.data[i+1];
      var b = frame.data[i+2];
      if (g > 120 && 2 > 50 && r < 165 && b < 60)
        frame.data[i + 3] = 0;
    }
    this.videocontentPlayer2.putImageData(frame, 0, 0);
    return;
  }
}
</script>

There is a missing comma seperator: 缺少逗号分隔符:

}, //here

pixelScan: function() {

pixelScan isn't a function. pixelScan不是功能。

You're missing a comma separator before pixelScan. 在pixelScan之前,您缺少逗号分隔符。

Should be 应该

this.myVideo.addEventListener("playing", function() {
        self.width = self.myVideo.videoWidth;
        self.height = self.myVideo.videoHeight;
        self.timerCallback();
        }, false);
    }
},
pixelScan: function() {

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 每次运行 function 时都想返回图像,但它一直给我一个错误。 这里出了什么问题? - Want to return an image everytime the function is run but it keeps giving me an error. What's wrong here? 我正在运行这个 javascript 代码,但它给了我一个..错误请告诉我出了什么问题,因为我认为代码是正确的? - I am running this javascript code but it is giving me an.. error please tell me what is wrong because I think the code is correct? Fibonacci 给我带来了问题,这段代码有什么问题? - Fibonacci is giving me problems, what’s wrong with this code? 谷歌地图不断给我同样的错误 - Google map keeps on giving me the same error 我的JavaScript有什么问题? 它不会计算和显示我想要的值; 这让我疯狂! - What is wrong with my JavaScript? It won't compute and display the value I want it to; it's driving me bonkers! JavaScript:有人可以告诉我我的代码出了什么问题吗? - JavaScript: Can someone tell me what's going wrong with my code? 有人可以告诉我我的下拉菜单javascript代码有什么问题吗 - Can someone tell me what's wrong with my dropdown menu javascript code 我的 index.js 文件有什么问题导致我出现这个错误 react-dom.development.js? - What's wrong in my index.js file that raise me this error react-dom.development.js? JavaScript parseInt 给了我错误的数字,我做错了什么? - JavaScript parseInt is giving me wrong number, what I'm doing wrong? Javascript switch 语句给了我一个错误。 到底是怎么回事? - Javascript switch statement is giving me an error. what is going on?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM