2016-11-07 6 views
0

내가 한 WebRTC + janusgateway + streamCapture를 사용하여 스트리밍 서비스를 구축하고WebRTC111 오류 : 예외 : DOMException [않고 InternalError :. "아니오 지역의 트랙 제안을 만들 수 없습니다, 아니 offerToReceiveAudio/비디오,없이 DataChannel

이, 스트리밍 비디오를 시작하지 :

public streamVideo() { 
    var video = $('#video1').get(0); 
     var stream; 

    video.onplay =() => { 
     if (video.captureStream) { 
     stream = video.captureStream(); 
     } else if (video.mozCaptureStream) { 
     stream = video.mozCaptureStream(); 
     } else { 
     alert('captureStream() not supported'); 
     } 

      console.log(stream); 
     $("#secondvideoforll").get(0).srcObject = stream; 

    this.sfutest.createOffer(
     { 
     media: { audioRecv: 0, videoRecv: 0, audioSend: 1, videoSend: 1}, // Publishers are sendonly 
     stream: stream, 
     success: (jsep) => { 
      Janus.debug("Got publisher SDP!"); 
      Janus.debug(jsep); 
      var publish = { "request": "configure", "audio": 1, "video": 1 }; 
      this.sfutest.send({"message": publish, "jsep": jsep}); 
     }, 
     error: (error) => { 
      Janus.error("WebRTC111 error:", error); 
     } 
     }); 
    } 
    } 

비디오 재생이 완벽하게 작동하지만, 내가 제안 (추가 addStream)를 만들려고 할 때이 오류가 얻을 :.

WebRTC111 error: DOMException [InternalError: "Cannot create an offer with no local tracks, no offerToReceiveAudio/Video, and no DataChannel." 
code: 0 
nsresult: 0x0] 

같은 서비스를 (스트림 매개 변수없이) 생성은 웹캠 스트리밍에서는 작동하지만 비디오 스트리밍에서는 작동하지 않습니다.

웹캠에서 가장 큰 차이점은 LocalMediaStream이며, streamCapture은 MediaStream입니다.

여기에 대한 의견이 있으십니까?

답변

0

video.captureStream()을 호출하면 getTracks()는 빈 배열을 반환하지만 1.5 초 후 예상대로 트랙을 반환합니다. 어떤 트랙이 추가되지 않은 경우는 생산

오류 : 다른 사람들이 혼란을 찾을 수 있습니다로 WebRTC111 error: DOMException [InternalError: "Cannot create an offer with no local tracks, no offerToReceiveAudio/Video, and no DataChannel

이 문서의 목적이 추가.

솔루션 :

setInterval(function(){ 
// We wait till the mediaTracks are added to mediaStream 
console.log(stream.getTracks()); 
// Further actions with the mediaStream 
}, 1000); 

감사합니다!

참조 번호 : https://github.com/w3c/webrtc-pc/issues/923