client-sdk-js icon indicating copy to clipboard operation
client-sdk-js copied to clipboard

Prewarm an audio element pool when connecting

Open lukasIO opened this issue 2 years ago • 2 comments

This PR

  • creates an audio element pool
  • tries to play silent audio when connecting and triggers audioPlaybackFailed if that doesn't work
  • adds playback of silent pool audio nodes to startAudio

potentially fixes https://github.com/livekit/client-sdk-js/issues/589, but there are some caveats:

  • user still needs to click startAudio when first connecting (also this will fire a lot more now)
  • only works if users do not supply their own HTML element to the attach function, because we can only use prewarmed elements if we can choose which element it can be

lukasIO avatar Mar 21 '23 15:03 lukasIO