livekit / client-sdk-unity

27 stars 12 forks source link

Cannot publish a texture stream #11

Closed AdamBuchweitz closed 4 days ago

AdamBuchweitz commented 11 months ago

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.");
        }
0xfacad3 commented 8 months ago

me too

arvinkx commented 4 months ago

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

cloudwebrtc commented 4 days ago

Fixed in the latest version