Javascript-对象不是集合
Javascript - Object not a collection
我试图用activex创建一个视频对象,但我犯了这个错误:"对象不是集合"。这是我的代码,错误从"This.parts=null;"行开始。这一行之前可能还有其他原因导致错误。我在网上搜索这个错误,但没有解决它的例子
function detailKeyPress(evt) {
var evtobj=window.event? event : evt;
switch (evtobj.keyCode) {
case KEYS.OK:
if (player.isFullScreen == false)
player.makeFullScreen();
else
player.makeWindowed();
break;
case KEYS.PLAY:
player.isPlaying = true;
player.object.play(1);
break;
case KEYS.PAUSE:
player.pause();
break;
case KEYS.STOP:
player.makeWindowed();
player.stop();
break;
}
}
function Player(id) {
this.id = id;
this.object = document.getElementById(id);
this.isFullScreen = false;
this.isPlaying = false;
this.parts = null;
return this;
}
Player.prototype.play = function () {
this.isPlaying = true;
return this.object.play(1);
}
Player.prototype.playByUrl = function (url) {
this.object.data = url;
return this.play();
}
document.onkeydown = function (evt) {
detailKeyPress(evt);
}
window.onload = function () {
player = new Player('playerObject');
player.playByUrl($mp4Link);
}
Player.prototype.makeFullScreen = function () {
try {
this.object.setFullScreen(true);
this.isFullScreen = true;
}
catch (ex) {//If philips
this.object.fullScreen = true;
this.isFullScreen = true;
}
}
Player.prototype.makeWindowed = function () {
try {
this.object.setFullScreen(false);
this.isFullScreen = false;
}
catch (ex) { //If philips
this.object.fullScreen = false;
this.isFullScreen = false;
}
}
Player.prototype.pause = function () {
this.isPlaying = false;
this.object.play(0);
}
Player.prototype.stop = function () {
this.isPlaying = false;
this.object.stop();
}
这可能是由注册表引起的。如果你清理它,你可以解决或者可能是一个错误。我也搜索了很多关于这个错误的信息。没有别的话可说了。
相关文章:
- Meteor-将选定窗体中的对象添加到集合中
- 微风得到的是实体而不是对象的集合
- MongoDB-通过比较集合和对象的数组来返回现有字段的数组
- 使用Undercore创建对象集合
- 我们可以用参数对象集合而不是原始数据来调用JavaScript collection.reduce()方法吗
- 如何在我传递给视图的ViewModel集合中获得jQuery可选对象的值,以作为有序列表进行迭代
- 将css属性添加到对象的集合中
- 如何查找流星集合中最后一个元素/对象的id
- 将一个对象集合映射到汇总集合的单个对象
- 将主干集合对象转换为其原始类型
- 在 Forerunner 数据库集合中创建主键时,key 属性是否可以位于集合对象的对象内部
- Expressjs&集合中的MongoDB更新对象's数组
- 使用下划线/Lo短划线更新集合对象
- 在 fetch 的成功和集合对象的绑定事件中编写代码有什么区别
- 尝试Backbone.js,我的集合对象没有加载数据
- 使用JQuery将自定义集合对象从控制器传递到视图
- 结合2 MongoDB集合对象下划线或其他东西
- Backbone.js-模型中的集合-对象函数(a){return new n(a)}没有方法'有'
- 在哪里格式化集合/对象
- 按带有下划线的属性值过滤重复的集合对象(不区分大小写和修剪)