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

Cannot publish a texture stream

Open AdamBuchweitz opened this issue 2 years ago • 2 comments

After following the Readme I have succeeded in publishing a Microphone stream, but I don't see any evidence that a video stream is working.

I'm using https://example.livekit.io/ to test.

I started by copy-pasting code from the Readme, but when that didn't provide a stream I refactored it to use async/await:

        private async Task PublishTexture()
        {
            var rt = new UnityEngine.RenderTexture(1920, 1080, 24, RenderTextureFormat.ARGB32);
            rt.Create();
            Camera.main.targetTexture = rt;
            var publish = _room.LocalParticipant.PublishTrack(
                 LocalVideoTrack.CreateVideoTrack("my-track", new TextureVideoSource(rt)),
                 new TrackPublishOptions { VideoCodec = VideoCodec.H264, Source = TrackSource.SourceScreenshare });
            while (!publish.IsDone)
                await Task.Yield();
            if (publish.IsError)
                Debug.LogError("There was an error publishing your videos.");
        }

AdamBuchweitz avatar Jul 20 '23 21:07 AdamBuchweitz

me too

0xfab0131 avatar Oct 28 '23 20:10 0xfab0131

@theomonnom Running into the same issue - are you aware of any workaround for this?

arvinkx avatar Feb 29 '24 11:02 arvinkx

Fixed in the latest version

cloudwebrtc avatar Jul 02 '24 05:07 cloudwebrtc