1
私はactivexでビデオオブジェクトを作成しようとしましたが、このエラーは「オブジェクトではありません」です。これは私のコードで、エラーは "this.parts = null;"という行から始まります。この行の前にエラーを引き起こす他の事があるかもしれません。私はネット上でこのエラーについて検索しますが、それを解決する例はありません。Javascript - オブジェクトではないコレクション
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();
}
はいです。私はエラーが部品の前に始まり、そこにこだわったと思います。 – user1277467
'this.parts = []'を試してみてください。 – kirilloid
私は試しましたが、変更はありません:S – user1277467