2014-12-02 7 views

답변

0

예제 코드를보고 대답했습니다. 열쇠는 connection.close()에 의한 전송을 멈추고 새로운 BLOB가 송신자로부터 오지 않게하고 수신기의 비디오의 src를 빈 문자열로 설정하는 것입니다.

var connection = new RTCPeerConnection({ iceServers: _iceServers }); 
... 
    // Close the connection between myself and the given partner 
    _closeConnection = function() { 
     if (_connection) { 
      _onStreamRemovedCallback(null, null); 

      // Close the connection 
      _connection.close(); 
     } 
    }, 
onStreamRemoved: function (connection, streamId) { 
      // todo: proper stream removal. right now we are only set up for one-on-one which is   why this works. 
      console.log('removing remote stream from partner window'); 

      // Clear out the partner window 
      var otherVideo = document.querySelector('.video.partner'); 
      otherVideo.src = ''; 
     } 
0
var vid = document.getElementById("myVideo"); 
vid.onpause = function() { 
    // change background color of element or add overlay to the element 
}; 
관련 문제