Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshare Video texture no longer updating after entering WebXR mode #46

Open
StefanoCavazzini opened this issue Jan 11, 2024 · 0 comments

Comments

@StefanoCavazzini
Copy link

We are using SDK version 1.5.0 in a Unity project version 2021.3.21f1 and are encountering an issue, screenshare video texture no longer updating after entering WebXR mode
I have several textures, these play videos perfectly fine in non WebXR mode.

Below is the code I use for the LocalTrackPublished and TrackSubscribed events:

private void HandleAddedTrack(Track track, TrackPublication publication, Participant? participant = null)
{
    if (track.Kind == TrackKind.Video && publication.TrackName == TrackName.ScreenSharel)
    {
        
        if (ScreenShareContainer.transform.childCount >= 2)
            return; // No space to show more than 1 tracks

        var video = track.Attach() as HTMLVideoElement;
        var newView = Instantiate(ScreenShareViewPrefab, ScreenShareContainer.transform);
        video.VideoReceived += tex =>
        {
            newView.texture = tex;
            Debug.Log("Reciving ScreenShare");
        };
        Canvas screenShareCanvans = GameObject.Find("Screenshare").GetComponent<Canvas>();
        screenShareCanvans.enabled = true;
    }
}

Any help is appreciated.

@StefanoCavazzini StefanoCavazzini changed the title Scrrenshare Video texture no longer updating after entering WebXR mode Screenshare Video texture no longer updating after entering WebXR mode Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant