Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField committed Jul 8, 2024
1 parent 72e3855 commit cd44a7a
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions src/examples/InstanceConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,25 @@ const ProducerInfo = (props: { networkID: InstanceID; value: any }) => {
() => {
if (value.dataChannel) {
const dataProducer = MediasoupDataProducerConsumerState.getProducerByDataChannel(networkID, value.dataChannel)
state.set(`- ${value.dataChannel} \n - closed: ${dataProducer.closed}\n - readyState: ${dataProducer.readyState}`)
return
if (dataProducer) {
state.set(`- ${value.dataChannel} \n - closed: ${dataProducer.closed}\n - readyState: ${dataProducer.readyState}`)
return
}
}
if (value.mediaTag) {
const mediaProducer = MediasoupMediaProducerConsumerState.getProducerByPeerIdAndMediaTag(
networkID,
value.peerID,
value.mediaTag
)
state.set(
`- ${value.mediaTag} \n - closed: ${mediaProducer.closed}\n - readyState: ${mediaProducer.readyState}`
)
if (mediaProducer) {
state.set(
`- ${value.mediaTag} \n - closed: ${mediaProducer.closed}\n - readyState: ${mediaProducer.readyState}`
)
return
}
}
state.set('')
},
{ after: PresentationSystemGroup }
)
Expand All @@ -55,19 +61,25 @@ const ConsumerInfo = (props: { networkID: InstanceID; value: any }) => {
() => {
if (value.dataChannel) {
const dataConsumer = MediasoupDataProducerConsumerState.getConsumerByDataChannel(networkID, value.dataChannel)
state.set(`- ${value.dataChannel} \n - closed: ${dataConsumer.closed}\n - readyState: ${dataConsumer.readyState}`)
return
if (dataConsumer) {
state.set(`- ${value.dataChannel} \n - closed: ${dataConsumer.closed}\n - readyState: ${dataConsumer.readyState}`)
return
}
}
if (value.mediaTag) {
const mediaConsumer = MediasoupMediaProducerConsumerState.getConsumerByPeerIdAndMediaTag(
networkID,
value.peerID,
value.mediaTag
)
state.set(
`- ${value.mediaTag} \n - closed: ${mediaConsumer.closed}\n - readyState: ${mediaConsumer.readyState}`
)
if (mediaConsumer) {
state.set(
`- ${value.mediaTag} \n - closed: ${mediaConsumer.closed}\n - readyState: ${mediaConsumer.readyState}`
)
return
}
}
state.set('')
},
{ after: PresentationSystemGroup }
)
Expand Down

0 comments on commit cd44a7a

Please sign in to comment.