Skip to content

Commit

Permalink
すまない、レースだった
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Feb 21, 2024
1 parent f0fff12 commit b64bfc3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/simulcast/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const sendonly = sora.sendonly(channelId, metadata, {
videoBitRate: 3000,
simulcast: true,
})
sendonly.on('notify', (event) => {
if (event.event_type === 'connection.created' && event.connection_id === sendonly.connectionId) {
document.querySelector('#local-video-connection-id').textContent = `${event.connection_id}`
}
})

const recvonlyR0 = sora.recvonly(channelId, metadata, {
simulcast: true,
Expand Down Expand Up @@ -75,9 +80,8 @@ document.querySelector('#start').addEventListener('click', async () => {
audio: false,
video: { width: { exact: 1280 }, height: { exact: 720 } },
})
await sendonly.connect(mediaStream)
document.querySelector('#local-video-connection-id').textContent = `(${sendonly.connectionId})`
document.querySelector('#local-video').srcObject = mediaStream
await sendonly.connect(mediaStream)

// recvonly r0
await recvonlyR0.connect()
Expand Down

0 comments on commit b64bfc3

Please sign in to comment.