Displaying Laptop Screen in VR

Hi support team,

I’m building an app where I need to show a laptop screen (real-time) inside a VR environment. Do you have any examples of how to do this?

Hey @bala ,

Welcome to the Magic Leap developer forums!

This question is less Magic Leap specific and more of a general XR development question, so I would suggest looking for support in other spaces. For example, if you’re working on a Unity project, try looking at the Unity forums or other Unity resources that are available.

Without knowing anything about your project development (Unity/Unreal/native app, what device, etc), I would look into libraries or API’s that can provide access to a desktop and stream it to your desired XR device in some way. There should be a few solutions out there and if you cannot find one that meets your projects needs, you may have to create your own solution.

Best of luck!
Corey

Hello @cfeist

Sorry for not being clear before. Let me explain my situation simply:

What I’m Using:

  • Magic Leap 2

  • Unity version 2022.3.62f2

What I’m Trying to Do: I want to show my computer screen (or specific windows from my computer) inside the Magic Leap 2 headset while I’m wearing it.

What I’m looking for:

  • How to capture desktop/window content in a way that’s compatible with the ML2 platform.
  • The best approach for real-time streaming or displaying this content.
  • Any ML2-specific considerations or limitations I should be aware of

Thank you for clarifying!

It seems you would need a few things so I’ll break them down here:

  1. You will need a capture source for your desktop (OBS, OBS WebRTC, or other)
  2. A way to transport capture data (via network stream)
  3. A ‘receiver’ from your Unity project that can decode the stream data and display it on a UI object.
    For this, you can look into Unity WebRTC package (Unity Render Streaming) or MixedReality- WebRTC, note that the MixedReality-WebRTC project has been deprecated by Microsoft.

To my knowledge, there are no all in one packages that would give you a full solution to what you’re looking for. You can always try looking at the Unity Asset Store and seeing if there is a package that meets your projects needs.

Best of luck and hope this helps!
Corey