Skip to content

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

Description

@StefanoCavazzini

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions