Allow peers w/o streams to receive streams, closes #26
Related to: https://github.com/feross/simple-peer/issues/95
This commit is contained in:
parent
8a8c7b570f
commit
df37ed93fb
@ -45,6 +45,6 @@ export const getCameraStream = () => dispatch => {
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
dispatch(NotifyActions.alert('Could not get access to microphone & camera'))
|
dispatch(NotifyActions.alert('Could not get access to microphone & camera'))
|
||||||
throw err
|
return null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,8 +83,14 @@ export function createPeer ({ socket, user, initiator, stream }) {
|
|||||||
|
|
||||||
const peer = new Peer({
|
const peer = new Peer({
|
||||||
initiator: socket.id === initiator,
|
initiator: socket.id === initiator,
|
||||||
stream,
|
config: { iceServers },
|
||||||
config: { iceServers }
|
// Allow the peer to receive video, even if it's not sending stream:
|
||||||
|
// https://github.com/feross/simple-peer/issues/95
|
||||||
|
offerConstraints: {
|
||||||
|
offerToReceiveAudio: true,
|
||||||
|
offerToReceiveVideo: true
|
||||||
|
},
|
||||||
|
stream
|
||||||
})
|
})
|
||||||
|
|
||||||
const handler = new PeerHandler({
|
const handler = new PeerHandler({
|
||||||
|
|||||||
@ -80,11 +80,11 @@ describe('reducers/alerts', () => {
|
|||||||
const promise = store.dispatch(CallActions.init())
|
const promise = store.dispatch(CallActions.init())
|
||||||
socket.emit('connect')
|
socket.emit('connect')
|
||||||
promise
|
promise
|
||||||
.then(done.fail)
|
.then(result => {
|
||||||
.catch(err => {
|
expect(result.value).toBe(null)
|
||||||
expect(err.message).toEqual('test')
|
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
|
.catch(done.fail)
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user