使用firefox streamId来流式传输屏幕共享

时间:2016-05-12 08:52:26

标签: javascript firefox webrtc

你好我有这个承诺:

var p = navigator.mediaDevices.getUserMedia(screencast)
.then(stream =>{
    console.log(stream);
    screencast = {
        audio: false,
        video: {
            streamId: stream.id,
            mediaSource:"screen" || "window"
        } 
    }
    setMediaConstraints(screencast, 'screen')
    startScreen()
})
.catch(err => 
    console.log("ERROR: ", err)
)

startScreen是我使用生成的媒体约束并保存在getMediaConstrains返回的对象中来流式传输屏幕的地方

ICE failed, see about:webrtc for more details

所以我想知道,也许我没有使用在正确的地方承诺返回的stream.id,对于chrome我做了:

screencast = {
    audio: false,
    video: {
        mandatory: {
            chromeMediaSourceId: stream.id,
            chromeMediaSource: "screen"
        }
    }

我在firefox中做错了什么?因为在chrome中你必须使用扩展来向你发送带有id的stream事件,但是在firefox中,扩展必须启用permisions,这样你就可以使用getUserMedia生成这个流对象了,所以也许我错过了一些重要的事情因为我选择了屏幕但是我不能流任何东西......

感谢您的帮助!

其他信息:

约:的WebRTC

(turn/INFO) TURN(relay(IP4:192.168.56.1:64862/UDP|numb.viagenie.ca:3478)): cancelling

(turn/WARNING) ICE-CANDIDATE(relay(IP4:192.168.56.1:64862/UDP|numb.viagenie.ca:3478)): nr_turn_allocated_cb called with state 4

(turn/WARNING) ICE-CANDIDATE(relay(IP4:192.168.56.1:64862/UDP|numb.viagenie.ca:3478)): nr_turn_allocated_cb failed

(stun/INFO) STUN-CLIENT(CkDk|IP4:192.168.56.1:64859/UDP|IP4:mediaserverip.com:42410/UDP(host(IP4:192.168.56.1:64859/UDP)|candidate:4 1 UDP 1677722111 mediaserverip.com 42410 typ srflx raddr 10.240.0.3 rport 42410)): Timed out

(ice/INFO) ICE-PEER(PC:1463046096935000 (id=76 url=https://localhost/tester):default)/CAND-PAIR(CkDk): setting pair to state FAILED: CkDk|IP4:192.168.56.1:64859/UDP|IP4:mediaserverip.com:42410/UDP(host(IP4:192.168.56.1:64859/UDP)|candidate:4 1 UDP 1677722111 mediaserverip.com 42410 typ srflx raddr 10.240.0.3 rport 42410)

(stun/INFO) STUN-CLIENT(IG6a|IP4:192.168.0.105:64860/UDP|IP4:mediaserverip.com:42410/UDP(host(IP4:192.168.0.105:64860/UDP)|candidate:4 1 UDP 1677722111 mediaserverip.com 42410 typ srflx raddr 10.240.0.3 rport 42410)): Timed out

(ice/INFO) ICE-PEER(PC:1463046096935000 (id=76 url=https://localhost/tester):default)/CAND-PAIR(IG6a): setting pair to state FAILED: IG6a|IP4:192.168.0.105:64860/UDP|IP4:mediaserverip.com:42410/UDP(host(IP4:192.168.0.105:64860/UDP)|candidate:4 1 UDP 1677722111 mediaserverip.com 42410 typ srflx raddr 10.240.0.3 rport 42410)

(ice/INFO) ICE-PEER(PC:1463046096935000 (id=76 url=https://localhost/tester):default)/STREAM(1463046096935000 (id=76 url=https://localhost/tester) aLevel=0)/COMP(1): All pairs are failed, and grace period has elapsed. Marking component as failed.

(ice/INFO) ICE-PEER(PC:1463046096935000 (id=76 url=https://localhost/tester):default): all checks completed success=0 fail=1

0 个答案:

没有答案