2012-03-20 3 views
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(); 
    } 
+0

네, 있습니다. 나는 오류가 부품들 앞에서 시작되어 거기에 붙어 있다고 생각한다. – user1277467

+0

'this.parts = []'을 시도해 보라. – kirilloid

+0

시도했지만 변경된 사항 없음 : S – user1277467

답변

1

이것은 레지스트리로 인한 것일 수 있습니다. 청소를하면 해결할 수도 있고 아마도 버그 일 수도 있습니다. 나는이 오류에 대해서도 많이 조사했다. 말할 것도 없습니다.

관련 문제