npm livekit-client 0.15.0
v0.15.0

latest releases: 2.15.7, 2.15.6, 2.15.5...
3 years ago

Room-before-connect API

In the initial version of LiveKit, it was not possible to create a Room object before it's fully connected. That design decision made it impossible to attach event listeners onto the Room before it was connected. The new API looks like this:

const room = new Room(opts?: RoomOptions)

// attach listeners
room.on(...)

await room.connect(url: string, token: string, opts?: RoomConnectOptions)

Top level connect will still be supported for backwards compatibility. Several functions have been moved as well:

  • createLocalTracks -> LocalParticipant.createTracks
  • createLocalVideoTrack -> LocalParticipant.createTracks({video: true})
  • createLocalAudioTrack -> LocalParticipant.createTracks({audio: true})
  • createLocalScreenTracks -> LocalParticipant.createScreenTracks

Other changes

  • Improved resize auto-management, reducing visible delay #84
  • Participant is passed as argument to RoomEvent.ParticipantMetadataChanged #86
  • Explicitly send video layers in use to SFU #85
  • Ability to unpublish tracks without stopping them #87
  • Improve bitrate & publishing defaults #89
  • Improved sample app #90 #94

Don't miss a new livekit-client release

NewReleases is sending notifications on new releases.