[英]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.