livekit / client-sdk-unity-web

Client SDK for Unity WebGL
Apache License 2.0
47 stars 15 forks source link

Cannot initialize non-default texture with negative or zero width on Unity 2023. #42

Closed marianmatees closed 8 months ago

marianmatees commented 8 months ago

Hello, I'm having an issue while trying to use this SDK on Unity 2023. I'm getting this error while trying to start a video using the webcam or screen sharing: livekit_error_unity2023

Everything works as intended on 2022 LTS. It seems like it is not possible anymore to create or resize a 2D texture to size 0. I think this is related to the problem I'm having in the above screenshot. This problem is little bit related to this one i found on the official unity forum found HERE.

Looking at the code HERE it seems that the VideoWidth and VideoHeight properties are set to 0 when the first SetupTexture() is called. I'm gonna create a pull request with a simple solution that helped me overcome this issue.

Kind Regards